Activate() public méthode

Marks the specified view as active.
If there is an active view before calling this method, that view will be deactivated automatically.
public Activate ( object view ) : void
view object The view to activate.
Résultat void
        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));
        }