wpf - Can Execute of a ICommand while a Context menu open -
a control has contextmenu
, menuitem
bound icommand
. icommand's can execute has code enable , disable menuitem
. hits while loading , checks can execute can hit while open contexmenu
, need hit(checks) each time while opening contextmenu
.
<border> <border.contextmenu> <contextmenu> <menuitem command="{binding savecommand, source={staticresource vm}}" commandparameter="{binding}" header="menu1" /> </contextmenu> </border.contextmenu> </border>
how done this. idea?
you should trigger event icommand.canexecutechanged() viewmodel shall cause control invoke canexecute viewmodel.
Comments
Post a Comment