Ejemplo n.º 1
0
        public void RegisterOneChildInNameScope()
        {
            WiringContext.EnableNameScope <DummyClass>();

            var actualInstance = XamlLoader.Load(Dummy.ChildInNameScope);
            var childInScope   = ((DummyObject)actualInstance).Find("MyObject");

            Assert.IsInstanceOfType(childInScope, typeof(ChildClass));
        }
Ejemplo n.º 2
0
        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));
        }
Ejemplo n.º 3
0
        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));
        }