-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Close flyout when clicking outside of it #965
Conversation
PreviewMouseDown on MetroWindow which tries to find a Flyout parent, if it does not exist, then close the open flyouts. PreviewMouseDown on flyoutModal to close modal flyouts when clicking on the darken area.
Could we add a property for enabling this feature? We don't want to break things. |
Yup, no problem. |
I'm not sure if this should be the default behavior, how about a flag in the Also this implementation currently responds to a left or right click, maybe we should make this customizable, so the developer can select if the flyout should handle the left, right or any mousebutton |
@Amrykid You beat me to it |
@flagbug Yeah, totally forgot about that. |
Just curious, is |
.... Probably. That's a good idea. |
Added properties for closing on mouse click.
Removed CloseOnExternalClick. Renamed ExternalClickMouseButton to NotPinnableCloseButton.
Some ideas: Rename The name |
I was guessing if |
@flagbug same idea here. |
Renamed IsPinnable to IsPinned and set it's default value to true.
Renamed NotPinnableCloseButton to ExternalCloseButton.
Added the ability to customize the mouse button that hides flyouts when Flyout::IsPinned is false.
Added OverrideIsPinned to be able to make all flyouts behave as if IsPinned is set to false (even if it is set to true).
Added functionality for FlyoutsControl::OverrideIsPinned, which makes all Flyouts behave as if IsPinned is set to false.
@flagbug It is now ready for a review. I also added the property |
🆒 can you add some descriptive XML docs for the properties respectively update the doc for |
public static readonly DependencyProperty OverrideIsPinnedProperty = | ||
DependencyProperty.Register("OverrideIsPinned", typeof(bool), typeof(FlyoutsControl), new PropertyMetadata(false)); | ||
|
||
public MouseButton ExternalCloseButton |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we make this the same as IsPinned
?
ExternalCloseButton
as property for each individual flyout and OverrideExternalCloseButton
for FlyoutControl
?
@flagbug Yes, totally, I'm just going to eat lunch real quick. |
Added ExternalCloseButton and updated documentation.
Replaced ExternalCloseButton with OverrideExternalCloseButton. Added documentation to OverrideIsPinned and OverrideExternalCloseButton.
Added implementation for FlyoutsControl::OverrideExternalCloseButton and Flyout::ExternalCloseButton.
@flagbug It's ready for another review. |
Looks good 👍 |
Cool, so if there aren't any objections, I'm gonna merge this |
Ah wait, our development model is a bit stupid. Have to wait for this till 0.12.1 is built |
…ors if the upper flyout is closing
Fixes issue #988
We introduce the property "OverrideDefaultWindowCommandsBrush" that is default by null. CleanWindowStyle ovverides this to "BlackBrush" This fixes #990
Fixes #995
Strange, I thought everything was indented correctly...
Added ExternalCloseButton and updated documentation.
#1000 Replaces this. |
Close Flyouts with external click (makes #965 obsolete)
PreviewMouseDown on MetroWindow which tries to find a Flyout parent, if it does not exist, then close the open flyouts.
PreviewMouseDown on flyoutModal to close modal flyouts when clicking on the darken area.
Fix_es #962
Should not be merged: #1000