I have a Menu
where each MenuItem
in the hierarchy has its Command
property set to a RoutedCommand
I\'ve defined. The as
I've implemented a solution to handle property dependency on commands, here the link https://stackoverflow.com/a/30394333/1716620
thanks to that you'll end up having a command like this:
this.SaveCommand = new MyDelegateCommand(this,
//execute
() => {
Console.Write("EXECUTED");
},
//can execute
() => {
Console.Write("Checking Validity");
return PropertyX!=null && PropertyY!=null && PropertyY.Length < 5;
},
//properties to watch
(p) => new { p.PropertyX, p.PropertyY }
);