/Visual Studio 2008/CSWPFNavigationUsage/MainPage.xaml
XAML | 77 lines | 62 code | 8 blank | 7 comment | 0 complexity | 84fc5ac0f1fbe07077322f164f101288 MD5 | raw file
- <Page x:Class="CSWPFNavigationUsage.MainPage"
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- Title="Main Page">
- <!--When a Hyperlink is clicked, WPF calls NavigationService.
- Navigate to locate and download the Page at the specified path-->
-
- <StackPanel>
- <!--use Hyperlink.NavigateUri property to navigate-->
- <Border CornerRadius="10" Background="Orange" BorderThickness="2" Padding="5" Margin="5">
- <WrapPanel>
- <TextBlock Text ="Navigate to" VerticalAlignment ="Center"/>
- <Label>
- <Hyperlink NavigateUri="Page1.xaml">
- page1
- </Hyperlink>
- </Label>
- <TextBlock Text="using Hyperlink.NavigateUri property" VerticalAlignment="Center"/>
- </WrapPanel>
- </Border>
-
- <!--use Hyperlink.NavigateUri property to navigate-->
- <Border CornerRadius="10" Background="Orange" BorderThickness="2" Padding="5" Margin="5">
- <WrapPanel>
- <TextBlock Text="Navigate to Page1 using Hyperlink.NavigateUri property. Click the image to navigate to Page1:" TextWrapping="Wrap"/>
- <Label>
- <Hyperlink NavigateUri="Page1.xaml">
- <Image Source="image.jpg" Stretch="Uniform" Height="100" />
- </Hyperlink>
- </Label>
- </WrapPanel>
- </Border>
-
- <!--handle Hyperlink.Click event and call NavigationService.Navigate method-->
- <Border CornerRadius="10" Background="Orange" BorderThickness="2" Padding="5" Margin="5">
- <WrapPanel>
- <TextBlock Text="Navigate to" VerticalAlignment="Center"/>
- <Label>
- <Hyperlink Click="OnHyperlink">
- Page1
- </Hyperlink>
- </Label>
- <TextBlock Text="by handling the Hyperlink.Click event and calling the NavigationService.Navigate method."
- VerticalAlignment="Center" TextWrapping="Wrap"/>
- </WrapPanel>
- </Border>
-
-
-
- <!--navigate to object by calling NavigationService.Navigate method-->
- <Border CornerRadius="10" Background="Orange" BorderThickness="2" Padding="5" Margin="5">
- <WrapPanel>
- <TextBlock Text="Navigate to" VerticalAlignment="Center"/>
- <Label>
- <Hyperlink Click="OnNavagateToObject">
- MyDummy object
- </Hyperlink>
- </Label>
- <TextBlock Text="by calling the NavigationService.Navigate method" VerticalAlignment="Center"/>
- </WrapPanel>
- </Border>
-
- <!--navigate to a Page with a Frame control in it by calling NavigationService.Navigate method-->
- <Border CornerRadius="10" Background="Orange" BorderThickness="2" Padding="5" Margin="5">
- <WrapPanel>
- <TextBlock Text="Navigate to" VerticalAlignment="Center"/>
- <Label>
- <Hyperlink Click="OnNavagateToPage">
- Page with Frame
- </Hyperlink>
- </Label>
- <TextBlock Text="by calling the NavigationService.Navigate method" VerticalAlignment="Center"/>
- </WrapPanel>
- </Border>
-
- </StackPanel>
- </Page>