02-实现页面的跳转的功能
来源:互联网 发布:淘宝书店怎么推广 编辑:程序博客网 时间:2024/04/29 20:28
1.主要的知识点:
NavigationService.navigate方法
实现步骤:
1.拖动添加工具箱中的button按钮到手机界面上,点中button按钮,右边的button标签背景色变为灰色,修改Content值为页面跳转
2.双击页面跳转按钮,进入代码编辑区
using System;using System.Collections.Generic;using System.Linq;using System.Net;using System.Windows;using System.Windows.Controls;using System.Windows.Documents;using System.Windows.Input;using System.Windows.Media;using System.Windows.Media.Animation;using System.Windows.Shapes;using Microsoft.Phone.Controls;namespace changePage{ public partial class MainPage : PhoneApplicationPage { // 构造函数 public MainPage() { InitializeComponent(); } //点击页面跳转按钮触发的方法,跳转到Welcome.xaml页面 private void button1_Click(object sender, RoutedEventArgs e) { NavigationService.Navigate(new Uri("/Welcome.xaml", UriKind.Relative)); } //页面跳转时触发的方法,让用户决定是否跳转页面 protected override void OnNavigatingFrom(System.Windows.Navigation.NavigatingCancelEventArgs e) { base.OnNavigatingFrom(e); if (MessageBox.Show("确定要跳到下个页面吗?", "警告提示", MessageBoxButton.OKCancel) == MessageBoxResult.Cancel) { e.Cancel = true; } } }}
3.创建跳转后的页面
4.新建页面
5.添加一个TextBlock,同样的修改里面的值
6.点击运行
运行效果:
- 02-实现页面的跳转的功能
- 跳转功能的实现
- 跳转页面的实现
- Flex实现页面跳转的功能可用性分析
- Flex实现页面跳转的功能可用性分析
- Flex实现页面跳转的功能可用性分析
- Flex实现页面跳转的功能可用性分析
- ionic结合angularjs实现跳转到上个页面的功能
- ssm中登录功能的实现以及页面跳转
- 页面自动跳转的实现
- JS实现页面的跳转
- PHP实现页面的跳转
- js实现页面的跳转
- android页面跳转的实现
- 实现页面的自动跳转
- js页面跳转的实现
- Intent实现页面的跳转
- Navigator实现页面的跳转
- java高新技术前期eclipse开发工具
- SICP 习题 (1.20) 解题总结
- 核心Swing组件(三)
- Open virtual effects in Ubuntu 12.04LTS
- VC++ IP地址
- 02-实现页面的跳转的功能
- java手法邮件
- 为什么C++中空类和空结构体大小为1?
- windows 服务的路径问题
- 核心Swing组件(四)
- 三种线性排序算法 计数排序、桶排序与基数排序
- javamail
- nextgen-gallery插件的使用
- c语言 输出不同类型所占的字节数