public void Activation_For_View_Fetcher_Should_Support_When_Activated()
        {
            var userControl = new TestUserControlWithWhenActivated();

            Assert.False(userControl.Active);

            var fakeRenderedDecorator = new TestRoot();

            fakeRenderedDecorator.Child = userControl;
            Assert.True(userControl.Active);

            fakeRenderedDecorator.Child = null;
            Assert.False(userControl.Active);
        }
Exemplo n.º 2
0
        public void Activation_For_View_Fetcher_Should_Support_When_Activated()
        {
            Locator.CurrentMutable.RegisterConstant(
                new AvaloniaActivationForViewFetcher(),
                typeof(IActivationForViewFetcher));

            var userControl = new TestUserControlWithWhenActivated();

            Assert.False(userControl.Active);

            var fakeRenderedDecorator = new TestRoot();

            fakeRenderedDecorator.Child = userControl;
            Assert.True(userControl.Active);

            fakeRenderedDecorator.Child = null;
            Assert.False(userControl.Active);
        }