Loading an MCML Page

Use the following to load an MCML page.

PageSession.GoToPage method

Most applications will use the PageSession.GoToPage method once to load the initial MCML page for the application. Although it can be called at any time from MCML, typically the application uses the Navigate element in MCML.

The PageSession.GoToPage method uses the page stack (puts pages on the back stack).

The Navigate element loads an MCML page from within MCML.

Source attribute of the Host element

The Source attribute of the Host element is used to dynamically change a child UI element at run-time after parsing. It allows you to change the UI element without loading or reloading the entire page, without code. This attribute can be used to share data between peer and child UI elements. The Host element can contain other Host elements or view items.

Application.LoadMcml method

The Application.LoadMcml method is advanced and is rarely used. It is not designed to be used for visible UI.

This method does the following:

  • Lets you get an object from within MCML.
  • Gives you access to the McmlLoadResult class, of which the BuildGlobal method is the most useful.
  • Is used for getting and building model items or non-visual objects, such as a tree of .NET types using MCML.
  • Loads MCML (pre-parses) and checks for parser errors before using it within an application.
  • Gives programmatic access to objects within MCML outside of a UI.

Sample Explorer

  • Page Navigation > Navigate and NavigateCommand
  • Page Navigation > HistoryOrientedPageSession

See Also