Open one XAML page from another XAML page …

Recently, I was required to dig lot deeper into new Silverlight 4 because of my work. I’ve been playing with previous versions but it was not “that” serious engagement, as it was never part of my “job” … I was just doing it to satisfy my craving for new technologies. But now I am required to learn it more seriously like my life (read as my job) depends on it Confused smile  …

As you already know, we can design/develop Silverlight application using either Visual Studio or Expression Studio (or specifically Expression Blend). But based on my experience with Silverlight (which is not much) design and development, I think Expression Blend is good tool to “Design” the application and Visual Studio is excellent tool for “Development” of the application. So, in a way now a days it is always required for developer to have super good understanding of both Expression Blend and Visual Studio (and latest version of Expression Blend is just awesome Thumbs up). Something that really bugs me about Silverlight is, it can’t communicate with database directly !! So, you are always required to make it talk with some kind of WCF service which is getting data from database, which can prove a bit difficult if you are amateur developer like me Open-mouthed smile

Anyways, today’s post is very basic. This is about some really stupid question I got stumbled upon and at first I had no clue about how to get it done !! I think it is because XAML is kind of new domain to me. As we know, navigation between any pages is very essential for any application. We do it PageName.OPEN() in winforms … and response.redirect()  (or something like that) in webforms but it is a bit different method to do when we are working with XAML. Actually its not that hard it can be done with just one line of code…

private void NextPage_Click(object sender, System.Windows.RoutedEventArgs e)
            // Page3 is just a Page Name
            this.Content = new Page3();

Well, I had to search many pages on google before I found this neat trick. I sure hope to use it in my next assignment.

That’s it for now.

It’s Just A Thought … Fingers crossed

Gaurang Sign

Leave a Reply

Your email address will not be published. Required fields are marked *