-
How do I add color to MetroWindows buttons?
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 10 replies
-
Hi @fabiociaf , I think there are two issues with your
if you are on MahApps v2.0 it should be: <Style x:Key="MeuMetroWindow" TargetType="{x:Type mah:MetroWindow}" BasedOn="{StaticResource {x:Type mah:MetroWindow}>
<Setter Property="NonActiveWindowTitleBrush" Value="{DynamicResource MahApps.Brushes.Accent}" />
<Setter Property="TitleAlignment" Value="Center" />
<Setter Property="TitleForeground" Value="{DynamicResource MahApps.Brushes.IdealForeground}"/>
<Setter Property="Background" Value="{DynamicResource MahApps.Brushes.ThemeBackground}"/>
<Setter Property="BorderBrush" Value="{DynamicResource MahApps.Brushes.Accent}" />
<Setter Property="WindowTitleBrush" Value="{DynamicResource MahApps.Brushes.Accent}" />
</Style> if you want to override the MahApps.Metro/src/MahApps.Metro/Styles/Controls.Buttons.xaml Lines 313 to 383 in bbab412 Happy coding |
Beta Was this translation helpful? Give feedback.
-
Hi @fabiociaf The issue is that you do not import all the needed styles. in your <!-- MahApps.Metro resource dictionaries. Make sure that all file names are Case Sensitive! -->
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Controls.xaml" />
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Fonts.xaml" />
<!-- Theme setting -->
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Themes/Light.Blue.xaml" /> See: https://mahapps.com/docs/guides/quick-start If you don't want to have MahApps-Style then please read: #4029 I'll send a PR to your sample Happy coding |
Beta Was this translation helpful? Give feedback.
-
@timunie That's why I didn't want to use
|
Beta Was this translation helpful? Give feedback.
Hi @fabiociaf
The issue is that you do not import all the needed styles.
in your
App.xaml
you need to add these toMergedDictionaries
:See: https://mahapps.com/docs/guides/quick-start
And here is the result:
If you don't want to have MahApps-Style then please read: #…