제목 : Page.xaml에서 Page2.xaml로 이동하는 예제
    
    
        
            
                | 글번호: |  | 2 | 
            
                | 작성자: |  | 레드플러스 | 
            
                | 작성일: |  | 2008/06/22 오후 4:01:18 | 
            
            
                | 조회수: |  | 5254 | 
            
        
     
 
    
	
	
    
	1. 3개의 XAML을 작성한다.
Page.xaml
Page2.xaml
PageSwitcher.xaml
2. App.xaml.cs의 시작개체를 PageSwitcher로 잡는다.
        private void Application_Startup(object sender, StartupEventArgs e)
        {
            this.RootVisual = new PageSwitcher();
        }
3. 내용이 없는 PageSwitcher.xaml을 아래와 같이 만든다.
PageSwitcher.xaml
<UserControl
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    x:Class="SilverlightApplication1.PageSwitcher"
    d:DesignWidth="640" d:DesignHeight="480">
</UserControl>
PageSwitcher.xaml.cs
using System.Windows.Controls;
namespace SilverlightApplication1
{
    public partial class PageSwitcher : UserControl
    {
        public PageSwitcher()
        {
            // Required to initialize variables
            InitializeComponent();
            if (this.Content == null)
            {
                this.Content = new Page();    
            }
        }
        public void Navigate(UserControl nextPage)
        {
            this.Content = nextPage;
        }
    }
}
4. Page.xaml에서 Page2.xaml로 이동하는 코드 예제
        private void btnSwitch_Click(object sender, RoutedEventArgs e)
        {
            PageSwitcher ps = this.Parent as PageSwitcher;
            ps.Navigate(new Page2());
        }
/// 언젠간 쓸일을 대비하여...