教程集 www.jiaochengji.com
教程集 >  脚本编程  >  Asp.net  >  正文 wpf实现框架frame中旧页面跳转新页面

wpf实现框架frame中旧页面跳转新页面

发布时间:2016-12-02   编辑:jiaochengji.com
教程集为您提供wpf实现框架frame中旧页面跳转新页面等资源,欢迎您收藏本站,我们将为您提供最新的wpf实现框架frame中旧页面跳转新页面资源
今天遇到问题,是怎么在frame嵌套的Page页面内,今天跳转那?下面我来给大家整理了一个例子,希望对各位有帮助。

这里有个方法非常简单:思路很简单,就是循环找到当前page的parent window,找到最顶级的然后跳转即可。

<table width="620" align="center" border="0" cellpadding="1" cellspacing="1" style="background:#FB7"> <tr> <td width="464" height="27" bgcolor="#FFE7CE"> 代码如下</td> <td width="109" align="center" bgcolor="#FFE7CE" style="cursor:pointer;" onclick="doCopy('copy8333')">复制代码</td> </tr> <tr> <td height="auto" colspan="2" valign="top" bgcolor="#FFFFFF" style="padding:10px;" class="copyclass" id=copy8333>

Frame pageFrame = null;
  DependencyObject currParent = VisualTreeHelper.GetParent(this);
  while (currParent != null && pageFrame == null)
  {
 pageFrame = currParent as Frame;
 currParent = VisualTreeHelper.GetParent(currParent);
  }
  // Change the page of the frame.
  if (pageFrame != null)
  {
 pageFrame.Source = new Uri("WindowPages/LawCase/LawCasePanel.xaml", UriKind.Relative);
}

您可能感兴趣的文章:
wpf实现框架frame中旧页面跳转新页面
JavaScript编程基础(13)-框架编程
js 3秒后跳转页面实例代码
JS的location.href跳出框架并打开新页面的方法
jquery、js操作frame,iframe的方法介绍
js自动刷新页面代码汇总
asp.net刷新页面的几种方法
PHP 登录完成跳转上一访问页面
js window.location、document.location、document.URL 对像的区别有哪些
js中页面的重新加载的方法

[关闭]
~ ~