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.
page.xamlとchildwindowがあります。page.xamlから子ウィンドウを閉じる方法。page.xamlのボタンをクリックして例を示します。コードからこのchildWindowを取得するにはどうすればよいですか?
ChildWindowオブジェクトにはCloseメソッドがあると思います。このメソッドを呼び出すと、ウィンドウが閉じます。
MSDNのドキュメントを参照してください。
ページの下にあるChildWindowの例にx:Name = "myChildWindow"という名前を付けます。コードの背後にあるxamlボタンクリックイベントは、これを配置します
myChildWindow.Close();