Navigating to Other Pages in a Windows Media Center Web Application

You can use Windows Media Center objects to navigate to other pages:

  • PageSession does not implement a page stack. Invoking a Back navigation returns the user to Windows Media Center.
  • HistoryOrientedPageSession implements an internal page stack and tracks page navigation. Use this object for multi-page applications.

It is not necessary to create a Back button and add functionality to navigate back in the page stackā€”the remote control Back button automatically handles this behavior for your application.

By default, Windows Media Center creates a HistoryOrientedPageSession object for all Windows Media Center web applications. To use the HistoryOrientedPageSession object in a Windows Media Center web application, you must define a PageSession property in the Properties section of the UI element, and it must be named "Session". For example:

<Properties>
    <host:PageSession Name="Session" PageSession="$Required"/>
</Properties>

You can use this session to invoke the HistoryOrientedPageSession.BackPage action to navigate to the previous page that you navigated from. For example:

<InvokeCommand Description="Go back to previous page"
               Target="[Session!host:HistoryOrientedPageSession.BackPage]" />

This syntax only works within a multi-page Windows Media Center web application.

You cannot use the Back page action to fully exit your application. You must use a method such as ApplicationContext.CloseApplication or PageSession.Close to force a back navigation from the first page of the application to Windows Media Center.

Sample Explorer

  • Page Navigation > HistoryOrientedPageSession

See Also