What is the best solution to allow user to login?

Sep 12, 2013 at 9:40 AM
I read several topics about this, but I have not found a way to create something like Skype:

At any time I would like to replace the entire content of the MainWindow with only two fields for
the username and password without back button and menu, after login all should be restored at previous state.

I thought of something like this:
//"this" is the MainWindow
this.Style = App.Current.Resources["EmptyWindow"] as Style;
this.Content = new LoginUserControl();
and for the restore:
this.ContentSource = new Uri("/Page1.xaml", UriKind.Relative);
this.Style = null;
There is a better solution?
Sep 14, 2013 at 1:12 PM
Try backing up the content and style in a variable and assign them whenever you need them back.