Trying to bind the ShowCriticalPath value to a toolbar checkbox
<CheckBox x:Name="CheckBoxShowCriticalPath" Content="Show Critical Path" IsChecked="False"/>
<syncfusion:GanttControl Grid.Column="0" Grid.Row="2" x:Name="Gantt"
ItemsSource="{Binding TaskCollection}"
WeekBeginsOn="Monday"
ShowWeekends="{Binding ElementName=CheckBoxShowWeekends, Path=IsChecked}"
ShowCriticalPath="{Binding ElementName=CheckBoxShowCriticalPath, Path=IsChecked}"
ValidationMode="Auto"
......
Toggling weekends on and off works OK but the same technique for toggling critical path just generates an error "System.Collections.Generic.KeyNotFoundException: 'The given key '' was not present in the dictionary.'" when setting ShowCriticalPath to true. If the checkbox starts off checked I can uncheck it OK but cannot set ShowCriticalPath back to true again.