Hi all,
Im just starting to get to grips with silverlight 3, coming from ASP.NET and Flex.
I have followed the new navigation tutorial here and read through the authentication and role management tutorials also.
So, i have a main page, which has a frame, inside of the grid, and several views. These are all navigatable and working fine. I see this main page as kind of a master page to my little application i have i mind.
So know I want to have a login.xaml UserControl. This will handle all login and once authenticated I want to navigate to the MainPage, and the use its frame to go from there.
I dont just want to simply use login as a seprate page within my frame as I want the login to use a different grid to the rest of the app, and also to be separate.
So how would I navigate from one user control (Login) to another (Main) ?
I have tried
private void btnLogin_Click(object sender, RoutedEventArgs e)
{
//TO - DO: All the auth work, just want navigation sorted first
this.Visibility = Visibility.Collapsed;
App.Current.RootVisual = new MainPage();
}
With no luck. Ive also tried just init'n a new main and setting its Visibility but this of course doesnt work.
Am I even approaching this in the correct way?
Thanks muchly.
Edit - Ok after digging a little further, this looks like an approach that will do what im after, but it does feel a little hackish! Is this the suggested way for siverlight 3? Thanks Again