been looking through google results quite hours , finding examples of how use routedcommand catch mouseclicks , keyboard shortcuts same actions.
i've read sources routedcommand msdn , https://joshsmithonwpf.wordpress.com/2008/03/18/understanding-routed-commands/ , if still understand right, should able need:
- click button in window2
- call method in window2
- call method in window1
- call method in window3 etc.pp.
the use case settings window holds language settings , upon clicking ok in settings active windows should change language strings. i've put method reloads strings language identifier.
so in general want buttonclick in window2 pass command call method "changelanguage(lng)" active windows parent mainwindow or childwindow not related settings @ all. window classes have own changelanguage() functions alter own strings.
i wonder if using custom eventhandler better in case , somehow make global every active window listen event fired when language being changed in settings window. found example global commandhandler @ question here that's not working event suppose.
- if view objects nested withing root control , click on button placed in root control can create tunnelingroutedevent go down visual tree. in window1, window2 etc. handle event.
- you can create static delegate methods window1, window2 etc. join , once delegate invoked associated methods invoked well.
- in case using prism, compositecommand looking for.
Comments
Post a Comment