Windows Phone 8.1 EventArgs类总结(C#描述)——NavigationEventArgs类
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了Windows Phone 8.1 EventArgs类总结(C#描述)——NavigationEventArgs类,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含2207字,纯文字阅读大概需要4分钟。
内容图文
NavigationEventArgs类
为无法取消的导航事件及事件处理器函数所需的数据。该类直接继承于Object类。
public sealed class NavigationEventArgs
该类所具有的成员有:
名称 | 访问类型 | 类别 | 说明 | 延伸 |
Content | 只读 | 属性(properties) | 获取目标页面的根节点 | |
NavigationMode | 只读 | 属性(properties) | 导航时的移动方向 | 可能的取值:New、Back、Forward、Refresh。 |
NavigationTransitionInfo | 只读 | 属性(properties) | 导航时的动画类型 |
public class NavigationTransitionInfo : DependencyObject
|
Parameter | 只读 | 属性(properties) | 传递的参数 | |
SourcePageType | 只读 | 属性(properties) | 源页面的数据类型 | |
Uri | 读写 | 属性(properties) | 目标内容的Uri |
举例:
1 private void NavigateButton_Click(object sender, RoutedEventArgs e) 2{ 3 ProgressRing1.IsActive = true; 4 5// Provide an indication as to where we are trying to navigate to 6 rootPage.NotifyUser(String.Format("Navigating to: {0}", Address.Text), NotifyType.StatusMessage); 7 8// Hook the LoadCompleted event for the WebView to know when the URL is fully loaded 9 WebView1.LoadCompleted += new Windows.UI.Xaml.Navigation.LoadCompletedEventHandler(WebView1_LoadCompleted); 1011// Attempt to navigate to the specified URL. Notice that a malformed URL will raise a FormatException 12// which we catch and let the user know that the URL is bad and to enter a new well-formed one.13try14 { 15 Uri targetUri = new Uri(Address.Text); 16 WebView1.Navigate(targetUri); 17 } 18catch (FormatException myE) 19 { 20// Bad address21 rootPage.NotifyUser(String.Format("Address is invalid, try again. Details --> {0}", myE.Message), NotifyType.ErrorMessage); 22 } 23} 2425void WebView1_LoadCompleted(object sender, Windows.UI.Xaml.Navigation.NavigationEventArgs e) 26{ 27 WebView1.Visibility = Windows.UI.Xaml.Visibility.Visible; 28 BlockingRect.Visibility = Windows.UI.Xaml.Visibility.Collapsed; 29 ProgressRing1.IsActive = false; 3031// Tell the user that the page has loaded32 rootPage.NotifyUser("Page loaded", NotifyType.StatusMessage); 33} 3435void Address_KeyUp(object sender, KeyRoutedEventArgs e) 36{ 37if (e.Key == Windows.System.VirtualKey.Enter) 38 { 39 NavigateButton_Click(this, new RoutedEventArgs()); 40 } 41 }
待续
原文:http://www.cnblogs.com/rogeryoung/p/4257698.html
内容总结
以上是互联网集市为您收集整理的Windows Phone 8.1 EventArgs类总结(C#描述)——NavigationEventArgs类全部内容,希望文章能够帮你解决Windows Phone 8.1 EventArgs类总结(C#描述)——NavigationEventArgs类所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。