Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个按钮,单击该按钮应打开一个新窗口作为模式窗口。我正在考虑this从 xaml 传递并在视图模型中,将父窗口作为Window.GetWindow(parameter). thisxaml中是否有任何等价物?
this
Window.GetWindow(parameter)
除非您处于断开连接的上下文中,否则您可以使用RelativeSource绑定来传递窗口AncestorType=Window。
RelativeSource
AncestorType=Window