none
Composite WPF: When to use Page within Views RRS feed

  • Question

  • Composite WPF (formerly Prism) has constructs for creating MVC/MVP on the client, but I'm not sure of the best practice for handling the requirement for displaying slightly different forms or form fields based on user selection (i.e., different data requirements based on country of origin).

    I've thought of three different ways for handling this:

    1. Use {DynamicResource ...} with ResourceDictionary files and load the appropriate ResourceDictionary based on the user's selection. Problems with this solution include how to bind unnecessary fields or fields that don't exist on the bound-to model property.
    2. Create a use case controller and a sub-container with regions and inject the necessary view "partial" UserControls into the view. The only problem I can think of here is the additional complexit of adding another controller, container, etc, though this more closely fits the way Composite WPF works.
    3. Use a Menu or Button to load in Page objects that relate to the view "partials." I found an example of this on CodeProject, and the solution looks both simple and effective, I'm just not sure if this would be the "correct" way to load view "partials" when using Composite WPF.

    I started with #1, but I'm currently leaning towards #3 because of its simplicity. Thoughts?

    • Edited by Ryan RileyMVP Wednesday, July 2, 2008 2:39 PM Updated HTML source for correct presentation.
    Wednesday, July 2, 2008 2:38 PM