Esempio n. 1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ShellViewModel"/> class.
 /// </summary>
 /// <param name="regionManager">The region manager.</param>
 public ShellViewModel(IRegionManager regionManager)
 {
     MainRegion = new Region();
     EditRegion = new SingleActiveRegion();
     regionManager.Regions.Add("MainRegion", MainRegion);
     regionManager.Regions.Add("EditRegion", EditRegion);
 }
        public void ActivatingNewViewDeactivatesCurrent()
        {
            IRegion region = new SingleActiveRegion();
            var view = new object();
            region.Add(view);
            region.Activate(view);

            Assert.IsTrue(region.ActiveViews.Contains(view));

            var view2 = new object();
            region.Add(view2);
            region.Activate(view2);

            Assert.IsFalse(region.ActiveViews.Contains(view));
            Assert.IsTrue(region.ActiveViews.Contains(view2));
        }