Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

How to unload a page

$
0
0

Hi Guys,

Here are the code snippets to load a page (pls see below).

I am wondering how to unload the page.

Thanks,

Richard.

Here is .xaml

<Window x:Class="WpfApplication1.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="MainWindow" Height="300" Width="300"><StackPanel><Frame Name="frame"/><Button Height="30" Click="Button_Click">BtnGoToPage01</Button></StackPanel></Window>

Here is .cs

private void BtnGoToPage01_Click(object sender, System.Windows.RoutedEventArgs e)
        {
            NavigationService NS = frame.NavigationService;
   	    NS.Navigate(new Uri("Page1.xaml", UriKind.Relative));
        }



Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>