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();

  • 相关阅读:
    Angularjs乱记
    tornado code
    angularjs中templateUrl的路径问题
    bat脚本禁用和开启本地连接
    http-server使用
    angularjs loading, animate
    tornado输出json
    cmder切换路径、设置命令别名
    python __setattr__和__getattr__
    滚动加载
  • 原文地址:https://www.cnblogs.com/-Apple/p/3156269.html
Copyright © 2011-2022 走看看