This project has moved and is read-only. For the latest updates, please go here.

Binding Views to XAP Files

Often you may have views located in a separate, dynamically loaded XAP file. However, why should you have to worry about the plumbing necessary to handle the load when the user requests the view for the first time? Jounce lets you treat all views the same: if you want to activate a view, you raise the ViewNavigationArgs event, and that's it.

If the view happens to live somewhere else, you can give Jounce a simple hint that maps the view tag to the XAP file it lives in. Anywhere in the project you simply export a ViewXapRoute like this:

public ViewXapRoute DynamicRoute
                return ViewXapRoute.Create("Dynamic", "RegionManagementDynamic.xap");

You may also perform runtime binding like this - you must be sure to execute this before you request the view:

public IFluentViewXapRouter XapRouter { get; set; }

public void MyMethod()

The first time the "Dynamic" view is requested, Jounce will automatically load the RegionManagementDynamic xap file.

Last edited Mar 27, 2011 at 4:26 PM by jeremylikness, version 3


No comments yet.