zoukankan      html  css  js  c++  java
  • WPF页面跳转

    WPF页面跳转有两种:一种是windows,另外一种是page 

    1:windows页面跳转
    windows 页面跳转相信学过winform编程的哥们都知道,先实例化该窗体然后show一下就可以了.eg:有两个窗体Main和Login,要想点击Login 窗体上的注册按钮然后跳转到Main上,则在Login窗体的Click事件里代码如下:Main Mn=new Main();Mn.Show();
    2:Page页面跳转Page页面跳转:前台跳转和后台跳转都可以实现前台实现:

    <TextBlockFontSize="24"TextWrapping="Wrap"Margin="0,0,0,0">

    <Hyperlinkx:Name="LnkPre"NavigateUri="Page1.xaml"Foreground="Black">

    Enter Page1

    </Hyperlink>

    </TextBlock>

    后台实现:

    NavigationService.GetNavigationService(this).Navigate(new Uri("Page1.xaml", UriKind.Relative));

    NavigationService.GetNavigationService(this).GoForward();//向后转

    NavigationService.GetNavigationService(this).GoBack(); //向前转

    在后台还可以这样写:this.content = new Page1();(这种比较简单,但是建议大家使用前一种更能提高自己,呵呵)
    另外还可以以实现windows跳转到page:

    NavigationWindow window =new  NavigationWindow();

    window.Source =new  Uri("Page1.xaml", UriKind.Relative);

    window.Show();

  • 相关阅读:
    关于 下载 nfs-utils时的 gssproxy conflicts with selinux-policy-3.13.1-102.el7.noarch 错误
    SCP命令
    DHCP服务
    NFS服务
    ssh免密登录
    可见性判断
    (八)图像处理
    (八)图像处理
    (八)Grahpics之Blit
    (七)时间动画_Time
  • 原文地址:https://www.cnblogs.com/dyllove98/p/3157308.html
Copyright © 2011-2022 走看看