I have my ContextMenu set up how i want it. Where do i put the InputBindings and Keybindings xaml to function inside the XamDataPresenter control?
Something like (for Cut:
<igDP:XamDataPresenter.InputBindings> <KeyBinding Key="X" Modifiers="Ctrl" Command="{Binding Path=CutCommand}"/> //what do put here-this binding doesn't work </igDP:XamDataPresenter .InputBindings>
<igDP:XamDataPresenter.InputBindings> <KeyBinding Key="X" Modifiers="Ctrl"
/> //what do put here-this binding doesn't work </
igDP:XamDataPresenter
.InputBindings>
Hello,
Thank you for your post. I have been looking into it and I suggest you create Instances of the Commands in your Window’s Resources and bind the KeyBinding’s Command to these instance through the StaticResources. Please let me know if this helps you or you need further clarifications on this matter.
Looking forward for your reply.
could you give a little more info on how to do that or an example?
You can see the “XamDataGridCommand.zip” sample from this forum thread:
http://forums.infragistics.com/forums/p/60752/316860.aspx#316860
where it is shown how to create, bind a command and set its Key shortcuts.
Hope this helps you.
I have already posted a sample project to your other forum thread:
http://community.infragistics.com/forums/p/63375/321001.aspx
there is nothing about keybindings or shortcuts in that sample. anyway, for my "ScratchPad" control, I have the "Cut" command defined in the ViewModel project, ViewScratchPad.cs In the control's code-behind, there is :
this.CutCommand = new RoutedCommand();
this.CutCommandBinding=new CommandBinding();
this.CutCommandBinding.Command=this.CutCommand;
this.CutCommandBinding.Executed+= new ExecutedRoutedEventHandler(CutCommandBinding_Executed);
this.CutCommandBinding.CanExecute+= new CanExecuteRoutedEventHandler(CutCommandBinding_CanExecute);