Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Custom CommandBindings are ignored after the update (Read 269 times)
nullable
Junior Member
**
Offline


I Love MindFusion!

Posts: 92
Joined: Aug 25th, 2022
Custom CommandBindings are ignored after the update
Jul 18th, 2024 at 9:08am
Print Post  
Hello, Mindfusion team.
I have a diagram class with custom logic. Before updating to a new version of Mindfusion, it inherited from the Diagram class, after the update - from the VirtualizingDiagram.
In this class I have a static constructor in which I call a method to override application commands (Copy, Paste, Cut) using the CommandManager.RegisterClassCommandBinding method. I tried binding them to Diagram and VirtualizingDiagram types - in both cases I get the SerializationException, which seems to be caused by default Mindfusion commands executing before custom ones. These overrides worked fine before the update, though. What could be the reason for this change in behavior?
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3244
Joined: Oct 19th, 2005
Re: Custom CommandBindings are ignored after the update
Reply #1 - Jul 19th, 2024 at 7:15am
Print Post  
Hi,

This prevents standard commands from being executed in my test:

Code
Select All
var copy = new CommandBinding(ApplicationCommands.Copy,
	(sender, args) => Debug.WriteLine("Copy"));
CommandManager.RegisterClassCommandBinding(
	typeof(VirtualizingDiagram), copy);

var paste = new CommandBinding(ApplicationCommands.Paste,
	(sender, args) => Debug.WriteLine("Paste"));
CommandManager.RegisterClassCommandBinding(
	typeof(VirtualizingDiagram), paste);
 



Please post your code and exception stack trace.

Regards,
Slavcho
Mindfusion
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint