File tree Expand file tree Collapse file tree 2 files changed +9
-6
lines changed Expand file tree Collapse file tree 2 files changed +9
-6
lines changed Original file line number Diff line number Diff line change 182
182
<DockPanel >
183
183
<ToggleButton Style =" {StaticResource MaterialDesignHamburgerToggleButton}" IsChecked =" False"
184
184
x : Name =" MenuToggleButton" />
185
- <materialDesign : PopupBox DockPanel.Dock=" Right" PlacementMode =" BottomAndAlignRightEdges" >
185
+ <materialDesign : PopupBox DockPanel.Dock=" Right" PlacementMode =" BottomAndAlignRightEdges" StaysOpen = " True " >
186
186
<StackPanel >
187
187
<Button Content =" Hello World" Click =" MenuPopupButton_OnClick" />
188
188
<Button Content =" Nice Popup" Click =" MenuPopupButton_OnClick" />
189
- <Button Content =" Goodbye" Click =" MenuPopupButton_OnClick" />
189
+ <Button Content =" Goodbye" Click =" MenuPopupButton_OnClick" />
190
190
</StackPanel >
191
191
</materialDesign : PopupBox >
192
192
<TextBlock HorizontalAlignment =" Center" VerticalAlignment =" Center" FontSize =" 22" >Material Design In XAML Toolkit</TextBlock >
Original file line number Diff line number Diff line change @@ -214,12 +214,14 @@ public DataTemplate PopupContentTemplate
214
214
set { SetValue ( PopupContentTemplateProperty , value ) ; }
215
215
}
216
216
217
+ [ Obsolete ]
217
218
public static readonly DependencyProperty StaysOpenOnEditProperty = DependencyProperty . Register (
218
219
nameof ( StaysOpenOnEdit ) , typeof ( bool ) , typeof ( PopupBox ) , new PropertyMetadata ( default ( bool ) ) ) ;
219
220
220
221
/// <summary>
221
- /// Indicates if the opup should stay open after a click is made inside the popup .
222
+ /// Prefer <see cref="StaysOpen"/> .
222
223
/// </summary>
224
+ [ Obsolete ]
223
225
public bool StaysOpenOnEdit
224
226
{
225
227
get { return ( bool ) GetValue ( StaysOpenOnEditProperty ) ; }
@@ -585,7 +587,7 @@ private static void OnLostMouseCapture(object sender, MouseEventArgs e)
585
587
if ( e . OriginalSource == popupBox )
586
588
{
587
589
if ( Mouse . Captured == null || popupBox . _popup == null || ! ( Mouse . Captured as DependencyObject ) . IsDescendantOf ( popupBox . _popup ) )
588
- {
590
+ {
589
591
popupBox . Close ( ) ;
590
592
}
591
593
}
@@ -601,8 +603,9 @@ private static void OnLostMouseCapture(object sender, MouseEventArgs e)
601
603
}
602
604
}
603
605
else
604
- {
605
- popupBox . Close ( ) ;
606
+ {
607
+ if ( ! popupBox . StaysOpen )
608
+ popupBox . Close ( ) ;
606
609
}
607
610
}
608
611
}
You can’t perform that action at this time.
0 commit comments