WPF Routed Commands and ShowDialog Windows
问题 I was wondering how a window opened through ShowDialog is treated in the Visual Tree. For example, Window A opens Window B through a ShowDialog. When firing a routed command on Window B, Window A does not receieve the command (even though it is listening for it). Is there any way to make this work? Thanks! Jon 回答1: We run into this situation all the time in our application. We use the Window.Owner property and ICommandSource.CommandTarget property for this. For example, in Window A: