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));
        }
Example #2
0
        public void ActivatingNewViewDeactivatesCurrent()
        {
            IRegion region = new SingleActiveRegion();
            var     view   = new ContentView();

            region.Add(view);
            region.Activate(view);

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

            var view2 = new StackLayout();

            region.Add(view2);
            region.Activate(view2);

            Assert.False(region.ActiveViews.Contains(view));
            Assert.True(region.ActiveViews.Contains(view2));
        }