public void ShouldCloseParentPopupOnButtonClick() { Popup parentPopup = new Popup(); var button = new ClickableButton(); button.SetValue(ButtonBehaviors.CloseAncestorPopupProperty, true); parentPopup.Child = button; parentPopup.IsOpen = true; button.RaiseClick(); Assert.IsFalse(parentPopup.IsOpen); }
public void ShouldCloseAncestorPopupOnButtonClick() { Popup ancestorPopup = new Popup(); var button = new ClickableButton(); button.SetValue(ButtonBehaviors.CloseAncestorPopupProperty, true); var immediateParent = new ContentControl(); immediateParent.Content = button; ancestorPopup.Child = immediateParent; ancestorPopup.IsOpen = true; button.RaiseClick(); Assert.IsFalse(ancestorPopup.IsOpen); }