Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

WindowButtonCommands enhancements #2378

Merged
merged 6 commits into from
Feb 29, 2016
Merged

Conversation

punker76
Copy link
Member

What changed?

  • use ContentPresenter to show the WindowButtonCommands, so it's now possible easier to change the min/max/close button styles
  • enable changing min/max/restore/close button tooltip
  • new Win10WindowButtonCommandsTemplate

2016-02-29_23h49_58

Closes #1972 Changing Close button icon.

@punker76 punker76 added this to the 1.3.0 milestone Feb 28, 2016
punker76 added a commit that referenced this pull request Feb 29, 2016
@punker76 punker76 merged commit d5b579b into develop Feb 29, 2016
@punker76 punker76 deleted the WindowButtonCommands-Enhancement branch March 1, 2016 08:31
@dgadelha
Copy link

A small question, how to use this?

@punker76
Copy link
Member Author

@dgadelha To use this style you should use the pre-release NuGet package. Then use it at the MetroWindow in this way

    <controls:MetroWindow.WindowButtonCommands>
        <controls:WindowButtonCommands Style="{DynamicResource MahApps.Metro.Styles.WindowButtonCommands.Win10}" />
    </controls:MetroWindow.WindowButtonCommands>

@dgadelha
Copy link

Oh nice, it worked.
Thanks a lot!

@wyw8152
Copy link

wyw8152 commented Dec 7, 2017

@punker76 A big question, how to use the Win10WindowButtonCommandsTemplate?

@punker76
Copy link
Member Author

punker76 commented Dec 7, 2017

@wyw8152

You can use it like this

    <Style BasedOn="{StaticResource MahApps.Metro.Styles.WindowButtonCommands}"
           TargetType="{x:Type Controls:WindowButtonCommands}">
        <Setter Property="Template" Value="{DynamicResource MahApps.Metro.Templates.WindowButtonCommands.Win10}" />
    </Style>

or

<Style TargetType="{x:Type Controls:WindowButtonCommands}" BasedOn="{StaticResource MahApps.Metro.Styles.WindowButtonCommands.Win10}" />

Put one of these styles in the App.xaml after the MahApps resources.

@dgadelha
Copy link

I checked out this again today and I found some details that don't match the Windows 10 style.

1- When hovering the Close button, it becomes red (#E81123):

image

2- Depending on the application base color (dark, light), when hovering a button a black or white semitransparent overlay is added to the button.

image

image

3- When the user holds the button (press the mouse button without leaving it), the opacity of the overlay mentioned in item 2 is increased.

image

image

4- When holding the close button, a white overlay is added (same mentioned in item 2, although just for pressing) even if the base color scheme is dark.

image

image

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Changing Close button icon.
3 participants