From 26d7aae51f2a1960a50eaaf6d8fc260c9ce0dce6 Mon Sep 17 00:00:00 2001 From: Dirkster99 Date: Thu, 13 Dec 2018 12:42:16 +0100 Subject: [PATCH] https://github.com/xceedsoftware/wpftoolkit/issues/1400 Checking if the mouse is outside the bounds of the DropDownButton when the PreviewMouseDownOutsideCapturedElement event tunnels through it to prevent the DropDownButton's Popup from closing if the event is caused by a child Popup --- source/DropDownButtonLib/Controls/DropDownButton.xaml.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/DropDownButtonLib/Controls/DropDownButton.xaml.cs b/source/DropDownButtonLib/Controls/DropDownButton.xaml.cs index 6ff554a..0a5dd74 100644 --- a/source/DropDownButtonLib/Controls/DropDownButton.xaml.cs +++ b/source/DropDownButtonLib/Controls/DropDownButton.xaml.cs @@ -432,7 +432,8 @@ private void OnKeyDown(object sender, KeyEventArgs e) /// private void OnMouseDownOutsideCapturedElement(object sender, MouseButtonEventArgs e) { - this.CloseDropDown(false); + if( !IsMouseOver ) + CloseDropDown( true ); } ///