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
How can I use a Menu in the window's titlebar ? #3447
Comments
GF-Huang
changed the title
How can I use a DropdownButton in the window's titlebar ?
How can I use a Menu in the window's titlebar ?
Feb 1, 2019
Solution left to those in need:
<Style xmlns:options="http://schemas.microsoft.com/winfx/2006/xaml/presentation/options"
x:Key="ButtonWindowCommandsDropDownStyle"
TargetType="Button"
BasedOn="{StaticResource ButtonDropDownStyle}">
<Style.Resources>
<!-- override the dynamic resources -->
<SolidColorBrush x:Key="GrayBrush8" options:Freeze="True" Color="Transparent" />
<SolidColorBrush x:Key="GrayBrush5" options:Freeze="True" Color="Transparent" />
<!-- for IsEnabled == False -->
<SolidColorBrush x:Key="GrayBrush10" options:Freeze="True" Color="Transparent" />
</Style.Resources>
</Style>
<Style x:Key="DropDownButtonWindowCommandsStyle"
TargetType="controls:DropDownButton"
BasedOn="{StaticResource {x:Type controls:DropDownButton}}">
<Setter Property="Orientation" Value="Vertical" />
<Setter Property="ArrowVisibility" Value="Collapsed" />
<Setter Property="BorderThickness" Value="0" />
<Setter Property="Opacity" Value="0.5" />
<Setter Property="Background" Value="Transparent" />
<Setter Property="Foreground" Value="White" />
<Setter Property="ButtonStyle" Value="{DynamicResource ButtonWindowCommandsDropDownStyle}" />
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Opacity" Value="1" />
</Trigger>
</Style.Triggers>
</Style>
<controls:MetroWindow.RightWindowCommands>
<controls:WindowCommands ShowLastSeparator="False">
<controls:DropDownButton Content="{iconPacks:Material Kind=Translate}"
Style="{StaticResource DropDownButtonWindowCommandsStyle}">
</controls:DropDownButton>
</controls:WindowCommands>
</controls:MetroWindow.RightWindowCommands> Effect: |
Good fix for a fixed theme, but not so good for customers that demand personalized themes. |
@lorinkundert For all the build-in themes, it doesn't seem to be a problem. 😄 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I want to put a
Menu
(because I need a single selection feature) intoRightWindowCommands
which has appearance like adefault button
insideRightWindowCommands
.I had try
DropdownButton
,MenuItem
,Menu with MenuItem
, but their appearance will be incompatible.The text was updated successfully, but these errors were encountered: