How to close a WPF page as a window

I want to close a WPF page, but Close() for the page does not work. In the WPF window, this.Close() closes the window, but on the WPF page it does not work.

+6
source share
2 answers

The page is not a window, and as such it is not directly Closable. Page documentation for the page , The page is intended for a "page of content that you can navigate to, and placed " ...

You will need to get a link to the page node and close it. If you place this page inside a window, you can close this window.

+1
source

replace the contents of the container controller where you placed the page with some other one or empty the contents of the container.

0
source

Source: https://habr.com/ru/post/889887/


All Articles