在WPF应用程序中可以将一个wpf页面导航到另一个wpf页面 [英] Its Possible to Navigate one wpf page to another wpf page in WPF applications

查看:80
本文介绍了在WPF应用程序中可以将一个wpf页面导航到另一个wpf页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用C#.net创建了WPF Windows应用程序...在这里我拥有2个xaml页面(即Windows1.xaml和Windows2.xaml ...我在Windows1.xaml ..这里添加了一个按钮(button1)我想在单击Windows1.xaml中的button1时导航到Windows2.xaml

请帮帮我.........

I Created my WPF windows application using C#.net...here i hav 2 xaml pages (i.e),Windows1.xaml and Windows2.xaml...i add one button(button1) in Windows1.xaml..here i want navigate to Windows2.xaml when am click on button1 in Windows1.xaml

Please help me out.........

推荐答案

单击按钮时:
When you click the button:
if(_myWindows2 == null)
{
    _myWindows2 = new Windows2();
    _myWindows2.Show();
}
else
    _myWindows2.Activate();


这篇关于在WPF应用程序中可以将一个wpf页面导航到另一个wpf页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆