public void RegisterOneChildInNameScope() { WiringContext.EnableNameScope <DummyClass>(); var actualInstance = XamlLoader.Load(Dummy.ChildInNameScope); var childInScope = ((DummyObject)actualInstance).Find("MyObject"); Assert.IsInstanceOfType(childInScope, typeof(ChildClass)); }
public void RegisterOneChildInNameScope() { WiringContext.EnableNameScope <DummyClass>(); sut.PumpNodes(source.ChildInNameScope); var actual = sut.Result; var childInScope = ((DummyObject)actual).Find("MyObject"); Assert.IsInstanceOfType(childInScope, typeof(ChildClass)); }
public void RegisterChildInDeeperNameScope() { WiringContext.EnableNameScope <Window>(); sut.PumpNodes(source.ChildInDeeperNameScope); var actual = sut.Result; var textBlock1 = ((Window)actual).Find("MyTextBlock"); var textBlock2 = ((Window)actual).Find("MyOtherTextBlock"); Assert.IsInstanceOfType(textBlock1, typeof(TextBlock)); Assert.IsInstanceOfType(textBlock2, typeof(TextBlock)); }