WPF SDK研究 Intro(5) QuickStart5

QuickStart5
    This sample shows you how to use Hyperlink elements to create a simple two-page Extensible Application Markup Language (XAML) application.
    该实例使用Hyperlink控件实现了两个页面的跳转,请在xaml中注意 Hyperlinkd的NavigateUri属性。

<!--     Page1     -->
< Page
    xmlns
= " http://schemas.microsoft.com/winfx/2006/xaml/presentation "
    xmlns:x
= " http://schemas.microsoft.com/winfx/2006/xaml " >
  
< StackPanel Background = " LightBlue " >
    
< TextBlock Margin = " 10,10,10,10 " > Start Page </ TextBlock >     
    
< TextBlock  HorizontalAlignment = " Left "
                Margin
= " 10,10,10,10 " >
      
< Hyperlink  NavigateUri = " Page2.xaml " > Go To Page  2 </ Hyperlink >
    
</ TextBlock >
  
</ StackPanel >
</ Page >


<!--     Page2     -->
< Page
  xmlns
= " http://schemas.microsoft.com/winfx/2006/xaml/presentation "
  xmlns:x
= " http://schemas.microsoft.com/winfx/2006/xaml " >
    
< StackPanel Background = " LightGreen " >
        
< TextBlock DockPanel.Dock = " Top "
              Margin
= " 10,10,10,10 " > Page  2 </ TextBlock >
        
< TextBlock  HorizontalAlignment = " Left "
                    Margin
= " 10,10,10,10 " >
            
< Hyperlink  NavigateUri = " Page1.xaml " > Go To The Start Page </ Hyperlink >
        
</ TextBlock >
    
</ StackPanel >
</ Page >

你可能感兴趣的:(start)