public void Control_Should_Not_Register_With_Template_NameScope() { var root = new TestRoot { Content = new Border { Name = "foo", } }; root.ApplyTemplate(); Assert.Null(NameScope.GetNameScope((Control)root.Presenter).Find("foo")); }
public void Control_Should_Not_Register_With_Template_NameScope() { var root = new TestRoot { Content = new Border { Name = "foo", } }; root.ApplyTemplate(); Assert.Null(NameScope.GetNameScope((Control)root.Presenter).Find("foo")); }
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 { Child = new Border { Name = "foo", Child = new Border { Name = "bar", } } }; root.ApplyTemplate(); Assert.Same(root.FindControl <Border>("foo"), root.Child); Assert.Same(root.FindControl <Border>("bar"), ((Border)root.Child).Child); }
public void Controls_Should_Register_With_NameScope() { var root = new TestRoot { Content = new Border { Name = "foo", Child = new Border { Name = "bar", } } }; root.ApplyTemplate(); ((ContentPresenter)root.Presenter).UpdateChild(); 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")); }
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")); }