Hi,
I am having a custom canvas derived from Canvas. It contains few ApplicationCommands like New/Open/Save etc. added like this -
this.CommandBindings.Add(new CommandBinding(ApplicationCommands.New, New_Executed,
New_Enabled));
New_Enabled always returns true.
This control is used in a wpf project having a menu bar; New/Open/Save menu button's are present in this menu bar with their Command set to respective ApplicationCommand like this -
<syncfusion:SimpleMenuButton
x:Name="NewMenu"
Icon="Images\New_Large.png"
Label="New"
IsEnabled="True"
Command="{x:Static ApplicationCommands.New}"
syncfusion:Ribbon.KeyTip="N">
</syncfusion:SimpleMenuButton>
Command works correctly when focus is present on Canvas but as soon as focus shifts to other control New button gets disabled. I have tried setting CommandTarget to main window but that too doesn't work.
Why this is happening and how can to make sure that New will always be enabled.