[Net_Ghost] WPF实例教程(6)
来源:互联网 发布:下载java软件 编辑:程序博客网 时间:2024/05/16 22:24
代码所在位置: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的图片如下图所示:
- [Net_Ghost] WPF实例教程(6)
- [Net_Ghost] WPF实例教程(1)
- [Net_Ghost] WPF实例教程(2)
- [Net_Ghost] WPF实例教程(3)
- [Net_Ghost] WPF实例教程(4)
- [Net_Ghost] WPF实例教程(5)
- Smarty实例教程(6)
- Micaps3.2二次开发实例教程-6
- javascript实例教程(20) 使用HoTMetal(6)
- Javascript实例教程(6) 利用Javascript进行密码保护
- smarty实例教程
- smarty实例教程
- smarty实例教程
- BPEL 实例教程
- BPEL 实例教程
- flash 实例教程
- BPEL实例教程
- DWR实例教程
- 学习街舞的误区
- cms显示所有的附件
- LINQ to SQL查询句法
- CMS图片对应文字以及设置固定的大小
- symbian中活动对象的简单使用
- [Net_Ghost] WPF实例教程(6)
- cms相关新闻
- 私の運転手もこの問題をよく知っています
- cms上下文章浏览
- dfsg
- WPF快速入手(一.1)
- Delphi2009的Indy全接触之HTTP篇
- df
- WPF快速入手(一).2