0
我有一个CommandTarget应该始终是父应用程序的命令绑定。CommandTarget绑定到Application.Current为空
的结合看起来是这样的:
CommandTarget="{Binding MainWindow, Source={StaticResource Application.Current}}"
然而,CommandTarget是从未得到绑定到主窗口 - 它总是空。
因此,事件处理程序的“发件人”正在根据调用它的窗口发生变化。
何时将Application.Current.MainWindow为空?为什么按钮被按下时不会重新评估绑定的CommandTarget?