Hi Zeljko Lazic,
Greetings from Syncfusion.
We have analyzed your query and we have achieved your requirement by using the below code snippet.
#Solution 1 : Binding directly to CheckBox IsChecked property
|
<CheckBox x:Name="checkBox" IsChecked="{Binding ShowToolbar}">Turn on zoom toolbar</CheckBox>
<syncfusion:SfChart Grid.Row="1">
<syncfusion:SfChart.Behaviors>
<syncfusion:ChartZoomPanBehavior EnableZoomingToolBar="{Binding Path=IsChecked, Mode=TwoWay, Source={x:Reference checkBox}}">
</syncfusion:ChartZoomPanBehavior>
</syncfusion:SfChart.Behaviors>
</syncfusion:SfChart> |
#Solution 2: Binding ViewModel property via Checkbox DataContext
|
<CheckBox x:Name="checkBox" IsChecked="{Binding ShowToolbar}">Turn on zoom toolbar</CheckBox>
<syncfusion:SfChart Grid.Row="1">
<syncfusion:SfChart.Behaviors>
<syncfusion:ChartZoomPanBehavior EnableZoomingToolBar="{Binding Path=DataContext.ShowToolbar, Mode=TwoWay, Source={x:Reference checkBox}}">
</syncfusion:ChartZoomPanBehavior>
</syncfusion:SfChart.Behaviors>
</syncfusion:SfChart> |
Also, we have attached the sample for your reference. Please find the sample form the below link.
Please let us know if you have any concern.
Regards,
Yuvaraj.