using System.Windows.Input; using LoadOnDemandDemo.ViewModel.Commands; using Microsoft.Practices.Composite.Modularity; using Microsoft.Practices.Composite.Regions; namespace LoadOnDemandDemo { public class ShellViewModel { #region Constructor public ShellViewModel(IModuleEnumerator moduleEnumerator, IModuleLoader moduleLoader, IRegionManager regionManager) { this.Initialize(moduleEnumerator, moduleLoader, regionManager); } #endregion #region Command Properties /// <summary> /// Loads Module A. /// </summary> public ICommand LoadModuleA { get; set; } /// <summary> /// Loads Module B. /// </summary> public ICommand LoadModuleB { get; set; } /// <summary> /// Unloads Module A. /// </summary> public ICommand UnloadModuleA { get; set; } /// <summary> /// Unloads Module B. /// </summary> public ICommand UnloadModuleB { get; set; } #endregion #region Module Properties /// <summary> /// The Prism module loader. /// </summary> public IModuleLoader ModuleLoader { get; set; } /// <summary> /// The Prism module enumerator. /// </summary> public IModuleEnumerator ModuleEnumerator { get; set; } /// <summary> /// The Prism region manager. /// </summary> public IRegionManager RegionManager { get; set; } #endregion #region Private Methods private void Initialize(IModuleEnumerator moduleEnumerator, IModuleLoader moduleLoader, IRegionManager regionManager) { // Initialize command properties this.LoadModuleA = new LoadModuleACommand(this); this.LoadModuleB = new LoadModuleBCommand(this); this.UnloadModuleA = new UnloadModuleACommand(this); this.UnloadModuleB = new UnloadModuleBCommand(this); // Initialize module properties this.ModuleEnumerator = moduleEnumerator; this.ModuleLoader = moduleLoader; this.RegionManager = regionManager; } #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.
This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)