Click here to Skip to main content
15,885,757 members
Articles / Desktop Programming / WPF

Composite WPF Display-on-Demand

Rate me:
Please Sign up or sign in to vote.
4.53/5 (10 votes)
30 Aug 2009CPOL6 min read 46.5K   1.3K   24  
Composite WPF Display-on-Demand.
using System.Collections.Generic;
using Microsoft.Practices.Composite.Modularity;
using Microsoft.Practices.Composite.Regions;

namespace ModuleA
{
    [Module(ModuleName = "ModuleA")]
    public class ModuleA : IModule
    {
        #region Fields

        // Member variables
        private readonly IRegionManager m_RegionManager;

        #endregion

        #region Constructor

        public ModuleA(IRegionManager regionManager)
        {
            m_RegionManager = regionManager;
        }

        #endregion

        #region IModule Members

        public void Initialize()
        {
            // Get main region
            var mainRegion = m_RegionManager.Regions["MainRegion"];

            // Load Module A
            var view = new ModuleAView();
            mainRegion.Add(view, "ModuleA.ModuleAView");
        }

        #endregion
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior) Foresight Systems
United States United States
David Veeneman is a financial planner and software developer. He is the author of "The Fortune in Your Future" (McGraw-Hill 1998). His company, Foresight Systems, develops planning and financial software.

Comments and Discussions