美图齐众专注资阳网站设计 资阳网站制作 资阳网站建设
资阳网站建设公司服务热线:028-86922220

网站建设知识

十年网站开发经验 + 多家企业客户 + 靠谱的建站团队

量身定制 + 运营维护+专业推广+无忧售后,网站问题一站解决

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://zsjierui.cn/article/dpjohpp.html

其他资讯