Welcome to WindowsClient.net | Sign in | Join

Creating Navigation Applications in WPF

There are 2 types of standalone applications in WPF, a standard WPF application which is more like the traditional windows application and a navigation application which is similar in some ways to a web application. A navigation application utilizes a navigation window to move from page to page. This presentation demonstrates how to create a WPF Navigation Application.

Author: Todd Miranda

Duration: 11 minutes 45 seconds

Video Downloads:
WMV | WMV (Zip) | Zune | iPod | PSP | MPEG-4 | 3GP

Audio Downloads:
AAC | WMA | MPEG-4 | MPEG-3 | MPEG-2

Sample Code:
VB | C#

You must Login to comment.Comments: 9

canararaghu: On September 16, 2008 3:45 PM said:

Good presentation!!

 

SaltyFoam: On September 16, 2008 4:15 PM said:

Why do you use the term "navigation application"? Isn't this simply a "wizard" window like in MFC and can't an application contain both "standard" windows and "navigation" windows?

 

tmiranda: On September 18, 2008 4:54 PM said:

SaltyFoam,

  When WPF first came out we would typically talk about building 3 main types of applications (not including XBAP): Standard apps, Navigation apps, and Gadget apps.  It is really an architectural description more than a technical differentiation.  Yes, you can use navigation windows/panels in a standard windows application.  But you can also build an application that architecturally is a "Navigation" application.  In this case the application itself would rely on "navigating" through the interface using the typical back/forward/history.  You typically don't think of a standard application being driven by navigation elements.  It is usually driven by a typical menu.  Hopefully this helps.

Todd

 

megame: On November 30, 2008 7:14 PM said:

What would be the best way of adding animations for transitions between pages?

Unlike the other parts of WPF this one looks very tricky to animate - handle navigating event, cancel navigation, animate, do animation?

 

tmiranda: On December 3, 2008 2:58 PM said:

megame,

  There are a number of ways to do this, a couple of which would be the easiest.  The first is to take a snapshot of the content of the page when navigation initiates.  A new form is displayed (pre-loaded) and the snapshot of the page is placed in this window (the snapshot could be accomplished with something like a visualbrush).  Immediately start the animation fade out. Once the content for the real target page is loaded, just fade that window back in.  So you effectively use a false window to accomplish the fade out while the main window which was hidden when navigation started can be used to fade it in.

  Another way to handle this is not to fade out the entire window but just the content.  So you could put the content in a container that you would fade in and out as navigation proceeded but the window container itself would not fade.

  Lastly, if you use the navigation classes and manually handle the navigation, you could use multiple windows instead of a single window.  In this case, you would easily fade window1 out and window2 in.  Then you could re-use window1 and window2 on the next navigation, swapping back and forth.  This method will require more code and manually handling navigation.  You still get to utilize the power of the navigation classes, but you will just handle all of the UI work manually.

I hope that makes sense and gives you a couple of ideas of what direction to head in.

Todd

 

ManjushaN: On January 7, 2009 10:19 AM said:

Hello,

1) I have 3 pages.

2) 2nd page has list of records in the Listview grid.When I click on one of the listed records it navigates to page 3.

  I am writing code in the Listview_Selectionchanged event

  NavigationService.Navigate(New Uri("Page3.xaml", UriKind.Relative)

3) I have back button on page3. When I click on the back button , it does goes to page2 ,it then calls the listview_selectionchanged event once again redirecting it back to page 3.And thats how I was getting page 3 again ?

In WPF we can perform Navigation in three main ways: Calling Navigate Method, Hyperlinks and Using Journal

I used Journal method :

If NavigationService.CanGoBack() Then

Me.NavigationService.GoBack()

Else

MessageBox.Show("No entries in back navigation history.")

End If

Can I use Navigate Method (NavigationService.Navigate(New Uri("Page2.xaml", UriKind.Relative))  instead of Journal method in getting the back functionality work ?

Any suggestions?

Thanks for all your help.

-M

 

ShadowOfTheBeast: On March 26, 2010 10:42 AM said:

when i click on play the media player disappears and nothing happens!

 

tombstarship: On August 5, 2010 9:37 AM said:

Sounds strange. i have spent hours looking thru text books and the net for a simple solution to this problem. Looked at the source code and got it working in minutes. Well done.

 

Siggy13: On August 26, 2010 8:25 PM said:

I am also experiencing the poblem of the media player vanishing when I try to run this video. I run other videos without any problems.

I would be grateful for any suggestions as to how to resolve this problem.

 



Featured Item