-
-
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
Move window when flyout is open #1821
Move window when flyout is open #1821
Conversation
…le mouse down and up events.
…yout theme and renaming event method names to more meaningful names in flyout control.
} | ||
} | ||
|
||
private void ClearParentWindowEvents(MetroWindow window) |
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.
this should be also called in FlyoutsControl
to avoid memory leaks (cause it's possible to have dynamic flyouts)
protected override void ClearContainerForItemOverride(DependencyObject element, object item)
{
var window = this.TryFindParent<MetroWindow>();
if (window != null)
{
((Flyout)element).ClearParentWindowEvents(window);
}
base.ClearContainerForItemOverride(element, item);
}
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.
Ok thanks Punker, added and sent the pull request.
…stion to avoid memory leaks when creating dynamic flyouts.
@hercmaroudas looks good, i'll be add this to 1.2.0 |
Thanks @punker76 👍 |
Looks ok, though I don't like that However, I would suggest some changes to your Flyout.xaml: In your PR you move the flyout's content down by the height of the titlebar. I'd prefer to keep the content where it is but overlay it with the
|
When a flyout was open you weren't able to move the window where the flyout was over the title bar. This was particularly anoying if you wished to move the window while a flyout was opened as a modal flyout or covered the entire area of the window.
I've implemented a change that enables the window to be moved when a flyout is opened and the mouse cursor is within the windows title bar area.
If the default behaviour was intended by design perhaps this feature could be optional with a property.
I hope this is ok.