WPF页面切换源码下载

上传者: ss_geng | 上传时间: 2021-07-01 09:17:36 | 文件大小: 1.56MB | 文件类型: ZIP
WPF页面切换源码 本文包括以下内容: 1. 如何实现Page切换 2. 如何为Page增加淡入淡出(Fade)效果 3. 示例 4. 下一步 如何实现Page切换 从MFC到Winform几乎切换方式是一致的,找到一个容器,然后将Dialog或是UserControl塞进去就完了,不断的Add/Remove来实现切换画面。在WPF中很不适应,缺少了Panel,不知道该从何而起。 在’WPF揭秘’和’WPF in Action’中都有提到使用NavigationWIndow或是Frame来实现导航,,只要Navigate就OK了。 操作起来也就3步: 1. 新建Application,Window1默认继承Window,这里改为继承自NavigationWindow,表示支持多Page。 2. 新建Page,任意数量。 3. 然后将NavigationWindow.Source设为默认页面(Default Page)。 4. 在Click中Navigation到相应的Page即可。 如何为Page增加淡入淡出(Fade)效果 如上所示,Window1继承自NavigationWindow,那么显然抓住Navigating事件不放,做如下操作: 1. 取消当前Navigate请求,如果有当前页的前提下。 2. 淡出当前页,如果有当前页的前提下。 3. 完成淡出过程后Navigate到目标页。 4. 淡入目标页。 3个页面如下: 1. 索引页,包括两个图标,点击分别进入相应页面 Page1,点击返回索引页。

文件下载

资源详情

[{"title":"( 51 个子文件 1.56MB ) WPF页面切换源码下载","children":[{"title":"WPFapp","children":[{"title":"WpfApplication1.sln <span style='color:#111;'> 935B </span>","children":null,"spread":false},{"title":"WpfApplication1","children":[{"title":"Page3.xaml.cs <span style='color:#111;'> 803B </span>","children":null,"spread":false},{"title":"Page2.xaml.cs <span style='color:#111;'> 803B </span>","children":null,"spread":false},{"title":"Page3.xaml <span style='color:#111;'> 553B </span>","children":null,"spread":false},{"title":"bin","children":[{"title":"Debug","children":[{"title":"WpfApplication1.vshost.exe <span style='color:#111;'> 13.99KB </span>","children":null,"spread":false},{"title":"WpfApplication1.exe <span style='color:#111;'> 411.50KB </span>","children":null,"spread":false},{"title":"WpfApplication1.vshost.exe.manifest <span style='color:#111;'> 490B </span>","children":null,"spread":false},{"title":"WpfApplication1.pdb <span style='color:#111;'> 75.50KB </span>","children":null,"spread":false}],"spread":true}],"spread":true},{"title":"from.gif <span style='color:#111;'> 4.83KB </span>","children":null,"spread":false},{"title":"obj","children":[{"title":"Debug","children":[{"title":"Page3.g.cs <span style='color:#111;'> 2.84KB </span>","children":null,"spread":false},{"title":"WpfApplication1.Properties.Resources.resources <span style='color:#111;'> 180B </span>","children":null,"spread":false},{"title":"WpfApplication1.exe <span style='color:#111;'> 411.50KB </span>","children":null,"spread":false},{"title":"Window1.g.cs <span style='color:#111;'> 2.87KB </span>","children":null,"spread":false},{"title":"Page2.g.cs <span style='color:#111;'> 2.84KB </span>","children":null,"spread":false},{"title":"Window1.baml <span style='color:#111;'> 756B </span>","children":null,"spread":false},{"title":"App.g.cs <span style='color:#111;'> 2.05KB </span>","children":null,"spread":false},{"title":"WpfApplication1.csproj.FileListAbsolute.txt <span style='color:#111;'> 3.01KB </span>","children":null,"spread":false},{"title":"WpfApplication1.csproj.GenerateResource.Cache <span style='color:#111;'> 789B </span>","children":null,"spread":false},{"title":"WpfApplication1.g.resources <span style='color:#111;'> 400.68KB </span>","children":null,"spread":false},{"title":"Page2.baml <span style='color:#111;'> 876B </span>","children":null,"spread":false},{"title":"WpfApplication1.pdb <span style='color:#111;'> 75.50KB </span>","children":null,"spread":false},{"title":"index.baml <span style='color:#111;'> 2.06KB </span>","children":null,"spread":false},{"title":"index.g.cs <span style='color:#111;'> 4.81KB </span>","children":null,"spread":false},{"title":"TempPE","children":null,"spread":false},{"title":"Page1.g.cs <span style='color:#111;'> 2.84KB </span>","children":null,"spread":false},{"title":"Page1.baml <span style='color:#111;'> 876B </span>","children":null,"spread":false},{"title":"WpfApplication1_MarkupCompile.cache <span style='color:#111;'> 306B </span>","children":null,"spread":false},{"title":"Page3.baml <span style='color:#111;'> 876B </span>","children":null,"spread":false}],"spread":false}],"spread":true},{"title":"Resources","children":[{"title":"JP_17-8-2009.jpg <span style='color:#111;'> 75.90KB </span>","children":null,"spread":false},{"title":"clock256.png <span style='color:#111;'> 25.03KB </span>","children":null,"spread":false},{"title":"pdc.jpg <span style='color:#111;'> 34.85KB </span>","children":null,"spread":false},{"title":"CA_16-9-2009.jpg <span style='color:#111;'> 78.30KB </span>","children":null,"spread":false},{"title":"CA_24-9-2009.jpg <span style='color:#111;'> 80.25KB </span>","children":null,"spread":false},{"title":"music256.png <span style='color:#111;'> 18.28KB </span>","children":null,"spread":false},{"title":"cl256.png <span style='color:#111;'> 20.15KB </span>","children":null,"spread":false},{"title":"movie256.png <span style='color:#111;'> 57.49KB </span>","children":null,"spread":false}],"spread":true},{"title":"Window1.xaml <span style='color:#111;'> 677B </span>","children":null,"spread":false},{"title":"Properties","children":[{"title":"Resources.Designer.cs <span style='color:#111;'> 2.81KB </span>","children":null,"spread":false},{"title":"Settings.settings <span style='color:#111;'> 201B </span>","children":null,"spread":false},{"title":"Resources.resx <span style='color:#111;'> 5.48KB </span>","children":null,"spread":false},{"title":"Settings.Designer.cs <span style='color:#111;'> 1.07KB </span>","children":null,"spread":false},{"title":"AssemblyInfo.cs <span style='color:#111;'> 2.17KB </span>","children":null,"spread":false}],"spread":true},{"title":"index.xaml <span style='color:#111;'> 1.64KB </span>","children":null,"spread":false},{"title":"WpfApplication1.csproj <span style='color:#111;'> 6.07KB </span>","children":null,"spread":false},{"title":"Page2.xaml <span style='color:#111;'> 553B </span>","children":null,"spread":false},{"title":"App.xaml <span style='color:#111;'> 296B </span>","children":null,"spread":false},{"title":"App.xaml.cs <span style='color:#111;'> 311B </span>","children":null,"spread":false},{"title":"Page1.xaml <span style='color:#111;'> 554B </span>","children":null,"spread":false},{"title":"index.xaml.cs <span style='color:#111;'> 1.13KB </span>","children":null,"spread":false},{"title":"Window1.xaml.cs <span style='color:#111;'> 2.75KB </span>","children":null,"spread":false},{"title":"Page1.xaml.cs <span style='color:#111;'> 1007B </span>","children":null,"spread":false}],"spread":false},{"title":"WpfApplication1.suo <span style='color:#111;'> 29.50KB </span>","children":null,"spread":false}],"spread":true}],"spread":true}]

评论信息

  • janedew :
    不错可以用
    2019-04-11
  • yuxiaoxuan1991 :
    可以学习。不错
    2016-09-23
  • p403828024 :
    效果还是可以的,学习一下
    2016-02-23
  • wyg0913oo :
    不错,挺有帮助的
    2015-06-11
  • hwzhong20 :
    不觉得有多大的学习价值
    2015-06-06

免责申明

【只为小站】的资源来自网友分享,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,【只为小站】 无法对用户传输的作品、信息、内容的权属或合法性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论 【只为小站】 经营者是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。
本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二条之规定,若资源存在侵权或相关问题请联系本站客服人员,zhiweidada#qq.com,请把#换成@,本站将给予最大的支持与配合,做到及时反馈和处理。关于更多版权及免责申明参见 版权及免责申明