重定向页面 [英] Redirect Page

查看:62
本文介绍了重定向页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我在Silverlight应用程序中使用了MVVM模型.
在我的登录控件中,我已将LoginCommand 绑定到我的按钮.

Hi,
I have used MVVM model in silverlight application.
In my login control I have bind LoginCommand to my button.

Command="{Binding LoginCommand}"


身份验证逻辑写在ViewModel类文件中.身份验证后,我想将此页面重定向到主页.我不知道该怎么做.

我使用了以下代码:


The authentication logic is written in ViewModel Class file. After authentication i want to redirect this page to Main page. I don''t know how to do it.

I have used following code:

System.Windows.Navigation.NavigationService obj = new System.Windows.Navigation.NavigationService();

obj.Navigate(new Uri("/Home",UriKind.Relative));


但它给人错误
System.Windows.Navigation.NavigationService尚未定义构造函数.

如果您有任何解决方案,请告诉我.
谢谢


But its giving error
System.Windows.Navigation.NavigationService has no constructors defined.

Please let me know if you have any solution.
Thanks

推荐答案

如果您将整个URL硬编码到您想去的地方,是否行得通?

如果是这样,您可以获取当前Silverlight页面的URL并进行适当的解析/修改
If you hard-code the entire URL to the place you want to go, does it work?

If so, you can get the url to the current silverlight page and parse/modify it appropriately


这篇关于重定向页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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