public void Controls_Should_Register_With_NameScope()
        {
            var root = new TestRoot
            {
                Content = new Border
                {
                    Name = "foo",
                    Child = new Border
                    {
                        Name = "bar",
                    }
                }
            };

            root.ApplyTemplate();

            Assert.Same(root.Find("foo"), root.Content);
            Assert.Same(root.Find("bar"), ((Border)root.Content).Child);
        }
        public void Controls_Should_Register_With_NameScope()
        {
            var root = new TestRoot
            {
                Content = new Border
                {
                    Name  = "foo",
                    Child = new Border
                    {
                        Name = "bar",
                    }
                }
            };

            root.ApplyTemplate();

            Assert.Same(root.Find("foo"), root.Content);
            Assert.Same(root.Find("bar"), ((Border)root.Content).Child);
        }
        public void Control_Should_Unregister_With_NameScope()
        {
            var root = new TestRoot
            {
                Content = new Border
                {
                    Name = "foo",
                    Child = new Border
                    {
                        Name = "bar",
                    }
                }
            };

            root.ApplyTemplate();
            root.Content = null;
            root.Presenter.ApplyTemplate();

            Assert.Null(root.Find("foo"));
            Assert.Null(root.Find("bar"));
        }
Beispiel #4
0
        public void Control_Should_Unregister_With_NameScope()
        {
            var root = new TestRoot
            {
                Content = new Border
                {
                    Name  = "foo",
                    Child = new Border
                    {
                        Name = "bar",
                    }
                }
            };

            root.ApplyTemplate();
            root.Content = null;
            root.Presenter.ApplyTemplate();

            Assert.Null(root.Find("foo"));
            Assert.Null(root.Find("bar"));
        }