Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Override command bindings (Read 1665 times)
Hunter
Full Member
***
Offline



Posts: 194
Location: Sevastopol
Joined: Dec 1st, 2009
Override command bindings
Jan 18th, 2010 at 1:32pm
Print Post  
Hello, Stoyan. I have a small question. How can I override the Ctrl+C(Ctrl+Insert) and Ctrl+V(Shift+Insert) modifiers?
I create a command such as
Code
Select All
		inputs = new InputGestureCollection();
		inputs.Add(keyGesture);
		keyGesture = new KeyGesture(Key.Insert, ModifierKeys.Control, "Ctrl+Insert");
		inputs.Add(keyGesture);
		m_CmdCopy = new RoutedUICommand("Копировать", "Copy",
		    typeof(MenuCommands), inputs);
 


All works ok. But I don't go to my event handler for this command. And when I call the command from menu I can stay in the body of my event handler. I suppose that key gestures works because some default command bindings are present
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Override command bindings
Reply #1 - Jan 18th, 2010 at 3:37pm
Print Post  
Hi there,

The control registers some class-level bindings for the Copy/Cut/Paste ApplicationCommands. You can override them by adding your own binding to an instance of the diagram as shown in this post:

http://mindfusion.eu/Forum/YaBB.pl?board=wpfdg_disc;action=display;num=123871818...

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Hunter
Full Member
***
Offline



Posts: 194
Location: Sevastopol
Joined: Dec 1st, 2009
Re: Override command bindings
Reply #2 - Jan 18th, 2010 at 3:48pm
Print Post  
Thank you very much
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint