public void Clearing_Content_Of_Popup_In_ControlTemplate_Doesnt_Crash() { using (UnitTestApplication.Start(TestServices.StyledWindow)) { var window = new Window(); var target = new TemplatedControlWithPopup { PopupContent = new Canvas(), }; window.Content = target; window.ApplyTemplate(); target.ApplyTemplate(); target.Popup.Open(); target.PopupContent = null; } }
public void PopupRoot_StylingParent_Is_Popup() { using (UnitTestApplication.Start(TestServices.StyledWindow)) { var window = new Window(); var target = new TemplatedControlWithPopup { PopupContent = new Canvas(), }; window.Content = target; window.ApplyTemplate(); target.ApplyTemplate(); target.Popup.Open(); Assert.Equal(target.Popup, ((IStyleHost)target.Popup.Host).StylingParent); } }