0
votes

I'm developing a silerlight application and have settled on the MVVM Light framework. One of the things I'm trying to do is create a "LoginStatus" control that can be used on multiple locations because we have different layouts that the pages are grouped into.

My challenge is how to redirect the page from a user control. When the users "logout" I want to redirect them to a different page not just a different View. Anybody have any thoughts or some examples that might do something like this.

Most of the examples I have seen out there just change the status on the current view.

dbl

1

1 Answers

0
votes

If you really want to navigate to a new page - i.e. leaving the silverlight application - you can use the Navigate method of the System.Windows.Browser.HtmlWindow class (documentation).

System.Windows.Browser.HtmlPage.Window.Navigate(
    new Uri("http://silverlight.net")
);

Otherwise, if you do not want to leave the silverlight application you simply navigate to a default view that informs the user that he is not logged in.

Edit:

For implementing a navigation service in Silverlight see for example this post or this post.