Reputation: 29
I'm trying to create a "Guide" app for a videogame. I want a button to clear everything in the window and show something else instead of creating another window. I've been using the code:
Window1 w1 = new Window1();
w1.Show();
this.Close();
Instead of this method, which closes the current window and opens a new one, is there a way to clear everything in the window and pop up other information?
Upvotes: 1
Views: 1359
Reputation: 956
You could create a Frame
in your MainWindow
and display different pages.
Xaml Frame:
<Frame x:Name="MainFrame" NavigationUIVisibility="Hidden" />
After that you create a new Page
-Control and navigate to it
var page = new CustomerPage();
MainFrame.Navigate(page);
Upvotes: 1