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

Impossible to toggle the visibility of TitleBar with UseNoneWindowStyle! #2338

Closed
gigios opened this Issue Feb 4, 2016 · 1 comment

Comments

Projects
None yet
2 participants
@gigios

gigios commented Feb 4, 2016

I have the necessity to start a window without border/control buttons/resize. To do this I have added some binding to the MetroWindow properies (UseNoneWindowStyle, IsWindowDraggable and ShowSystemMenuOnRightClick).
With this settings all works fine but when I change the property defined in the ViewModel (in binding with UseNoneWindowStyle), the ShowTitleBar property stay False!
I have checked the code and in the MetroWindow.cs, the method ToggleNoneWindowStyle, set the ShowTitleBar ONLY to false without any 'restore' to true when the useNoneWindowStyle is set to false.
Another behavior is that, if I have set a binding with the ShowTitleBar, I lose this binding!

@punker76 punker76 added this to the 1.4.0 milestone Sep 20, 2016

@punker76 punker76 closed this in a62ba41 Nov 20, 2016

@punker76

This comment has been minimized.

Show comment
Hide comment
@punker76

punker76 Nov 20, 2016

Member

@gigios There is a coerce value callback for the ShowTitleBar property which causes your binding

private static object OnShowTitleBarCoerceValueCallback(DependencyObject d, object value)
{
    // if UseNoneWindowStyle = true no title bar should be shown
    if (((MetroWindow)d).UseNoneWindowStyle)
    {
        return false;
    }
    return value;
}
Member

punker76 commented Nov 20, 2016

@gigios There is a coerce value callback for the ShowTitleBar property which causes your binding

private static object OnShowTitleBarCoerceValueCallback(DependencyObject d, object value)
{
    // if UseNoneWindowStyle = true no title bar should be shown
    if (((MetroWindow)d).UseNoneWindowStyle)
    {
        return false;
    }
    return value;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment