I have to perform a binding using ICommand, but it seems like the specific class I'm declaring my ICommand is not even triggered. I have defined following button in my AccView.xaml UserControl
<Button x:Name="buttonInit" Content="init" Height="32" Cursor="Hand" Command="{Binding initCommand}" HorizontalAlignment="Left" Margin="24,43,0,0" VerticalAlignment="Top" Width="156" Style="{DynamicResource RoundCornerButton}" />
I'm then using the specific class SetAccValues.cs:
public class GetAccValues : AccView
{
public ICommand initCommand
{
get { return new DelegateCommand<object>(initBluetooth, canInit); }
}
private async void initBluetooth(object context)
{
int serviceNumb = 1;
await InitializeAsync(PerformAccOperations.Readings.None, serviceNumb);
if (SensorOK && Initialized != null) Initialized(this);
}
private bool canInit(object context)
{
return true;
}
}
But the problem is that the ICommand is not even triggered when I'm pressing the button. Where is the problem in this case ?.