WPF页面跳转实现方法详解

WPF页面跳转在实际程序开发中是经常会被用到的一个功能需求。在实现WPF页面跳转这一功能的时候,可以分为两种情况,分别为:前台跳转和后台跳转。#t#

创新互联公司主营万山网站建设的网络公司,主营网站建设方案,app开发定制,万山h5成都微信小程序搭建,万山网站营销推广欢迎万山等地区企业咨询

WPF页面跳转之前台转:

  1. < TextBlock FontSize="24" 
    TextWrapping="Wrap" 
    Margin="0,0,0,-19.998"> 
  2. < Hyperlink x:Name="LnkPre"
     NavigateUri="Page2.xaml" 
    Foreground="Black"> 
  3. Enter Page2  
  4. < /Hyperlink> 
  5. < /TextBlock> 

WPF页面跳转之后台转:

 
 
 
  1. NavigationService.GetNaviga
    tionService(this).Navigate
    (new Uri("Page2.xaml", 
    UriKind.Relative));  
  2. NavigationService.GetNavi
    gationService(this).GoForward();
    向后转  
  3. NavigationService.GetNavi
    gationService(this).GoBack(); 
     向前转  
  4. if (Application.Current.
    Properties["TaskResult"] 
    == null) return;  
  5. bool taskResult = (bool)
    Application.Current.Properties
    ["TaskResult"];  
  6. if (!taskResult) return;  
  7. // If a task happened, 
    display task data  
  8. string taskData = (string)
    Application.Current.Properties
    ["TaskData"];  
  9. if (taskData == null) return;  
  10. // "End" the task be removing 
    state associated with   
  11. // its existence  
  12. Application.Current.Properties
    ["TaskResult"] = null;  
  13. Application.Current.Properties
    ["TaskData"] = null; 

网页标题:WPF页面跳转实现方法详解
本文链接:http://www.gydahua.com/article/dpjohpp.html
扫二维码与项目经理沟通

我们在微信上24小时期待你的声音

解答本文疑问/技术咨询/运营咨询/技术建议/互联网交流