public void DeActivatingWindowRemovesViewFromRegion()
        {
            var target = new NewWindowRegionBehavior();
            target.Region = new Region();
            target.Region.Behaviors.Add("Key", new TwoWayActiveAwareBehavior());

            target.Attach();
            var mockWindow = new MockWindow();

            target.Region.Add(mockWindow);

            mockWindow.IsActive = true;
            mockWindow.IsActive = false;
            
            Assert.IsFalse(target.Region.Views.Contains(mockWindow));

        }
Ejemplo n.º 2
0
        public void DeActivatingWindowRemovesViewFromRegion()
        {
            var target = new NewWindowRegionBehavior();

            target.Region = new Region();
            target.Region.Behaviors.Add("Key", new TwoWayActiveAwareBehavior());

            target.Attach();
            var mockWindow = new MockWindow();

            target.Region.Add(mockWindow);

            mockWindow.IsActive = true;
            mockWindow.IsActive = false;

            Assert.IsFalse(target.Region.Views.Contains(mockWindow));
        }
        public void ActivatingViewShowsWindow()
        {
            var target = new NewWindowRegionBehavior();
            target.Region = new Region();
            target.Region.Behaviors.Add("Key", new TwoWayActiveAwareBehavior());

            target.Attach();
            var mockWindow = new MockWindow();
            target.Region.Add(mockWindow);

            Assert.IsFalse(mockWindow.IsShown);

            mockWindow.IsActive = true;

            Assert.IsTrue(mockWindow.IsShown);

            mockWindow.IsActive = false;

            Assert.IsFalse(mockWindow.IsShown);
        }
Ejemplo n.º 4
0
        public void ActivatingViewShowsWindow()
        {
            var target = new NewWindowRegionBehavior();

            target.Region = new Region();
            target.Region.Behaviors.Add("Key", new TwoWayActiveAwareBehavior());

            target.Attach();
            var mockWindow = new MockWindow();

            target.Region.Add(mockWindow);

            Assert.IsFalse(mockWindow.IsShown);

            mockWindow.IsActive = true;

            Assert.IsTrue(mockWindow.IsShown);

            mockWindow.IsActive = false;

            Assert.IsFalse(mockWindow.IsShown);
        }