public void PopupRoot_Should_Have_Template_Applied() { using (CreateServices()) { var target = new Popup(); var child = new Control(); target.Open(); Assert.Equal(1, target.PopupRoot.GetVisualChildren().Count()); var templatedChild = target.PopupRoot.GetVisualChildren().Single(); Assert.IsType<ContentPresenter>(templatedChild); Assert.Equal(target.PopupRoot, ((IControl)templatedChild).TemplatedParent); } }
public void PopupRoot_Should_Have_Null_VisualParent() { using (CreateServices()) { var target = new Popup(); target.Open(); Assert.Null(target.PopupRoot.GetVisualParent()); } }
public void PopupRoot_Should_Have_Popup_As_LogicalParent() { using (CreateServices()) { var target = new Popup(); target.Open(); Assert.Equal(target, target.PopupRoot.Parent); Assert.Equal(target, target.PopupRoot.GetLogicalParent()); } }
public void PopupRoot_Should_Have_Child_As_LogicalChild() { using (CreateServices()) { var target = new Popup(); var child = new Control(); target.Child = child; target.Open(); Assert.Equal(new[] { child }, target.PopupRoot.GetLogicalChildren()); } }