WPF实例学习(A-05)
2006-07-02 22:07
411 查看
代码所在位置:WPFSamples/Intro/QuickStart5
这个例子没有.cs文件,只有三个XAML文件,实现了在两个页面之间的跳转
MyApp.xaml
<Application
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
StartupUri="Page1.xaml">
</Application>
程序运行直接显示Page1
Page1.xaml
<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>
Page1,如下图所示
下面这行代码,定义了一个超链接,点击就可以连接到Page2
<Hyperlink NavigateUri="Page2.xaml">Go To Page 2</Hyperlink>
Page2.xaml
<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>
链接到Page2的图片如下图所示:
这个例子没有.cs文件,只有三个XAML文件,实现了在两个页面之间的跳转
MyApp.xaml
<Application
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
StartupUri="Page1.xaml">
</Application>
程序运行直接显示Page1
Page1.xaml
<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>
Page1,如下图所示
下面这行代码,定义了一个超链接,点击就可以连接到Page2
<Hyperlink NavigateUri="Page2.xaml">Go To Page 2</Hyperlink>
Page2.xaml
<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>
链接到Page2的图片如下图所示:
相关文章推荐
- WPF实例学习(A-02)
- WPF实例学习(00)
- WPF实例学习(A-03)
- [转载] WPF实例学习 (A-01)
- WPF实例学习(A-04)
- WPF实例学习(A-04)
- WPF学习05:2D绘图 使用Transform进行控件变形
- WPF实例学习(A-01)
- WPF实例学习(A-02)
- activiti学习--05流程实例:部署流程定义+部署流程定义+查询当前人的个人任务+完成我的任务
- activiti学习--05流程实例:查询流程状态+查询历史任务+查询历史流程实例
- Linux 驱动学习笔记05--字符驱动实例,实现一个共享内存设备的驱动
- WPF学习笔记 - 如何用WPF创建单实例应用程序
- WPF学习笔记 - 如何用WPF创建单实例应用程序
- WPF学习实例 -- 股票行情查看程序
- WPF实例学习(A-03)
- java基础学习05(面向对象基础01--类实例分析)
- WPF + USB Camera 学习实例
- WPF 学习记录——源码实例
- WPF实例学习(A-01)