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); }
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); }