Find MahApps Metro title bar color - wpf

I am using MahApps Metro and i'm trying to get to TitleBar color to use it with other controllers:
In App.xaml file all i can see is:
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Accents/BaseLight.xaml" />
Which is the theme name, i can change BaseLight to Red for exapmle and my TitleBar become Red but i really like this color.
Any suggestions how to find this color ?

It should be
AccentColorBrush
You can access it like this:
<TextBox Background="{DynamicResource AccentColorBrush}" />

Related

Design Time changes based on MaterialDesignInXAML

I am using MaterialDesignInXAML in WPF using C# (.net Core 3.1).
https://github.com/MaterialDesignInXAML/MaterialDesignInXamlToolkit
How do I set it to dark mode for the design time editor?
I set my main window to have:
TextElement.Foreground="{DynamicResource MaterialDesignForeground}"
Background="{DynamicResource MaterialDesignPaper}"
FontFamily="{DynamicResource MaterialDesignFont}"
App.xaml has:
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<materialDesign:BundledTheme BaseTheme="Light" PrimaryColor="DeepPurple" SecondaryColor="Lime" />
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Defaults.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
There is no code behind.
I know I can modify the Theme at runtime, that is not an issue. But I know there is a way to modify it at design time. (I want my Visual Studio window to show the dark background etc when editing.)
When running MaterialDesignToolKit.Full (from https://github.com/MaterialDesignInXAML/MaterialDesignInXamlToolkit/releases) The MaterialDesignDemo.
It has dark mode enabled in the editor. I've been looking through it but can't seem to spot why.
I'm sure it's something simple but the app.xaml seems to be the same. I'm missing something obviously.
Any ideas?
You should set the BaseTheme property to Dark in your App.xaml to apply the dark theme:
<materialDesign:BundledTheme BaseTheme="Dark" PrimaryColor="DeepPurple" SecondaryColor="Lime" />

material design xaml different themes / color palette for different windows / controls

WPF using Material Design Toolkit.
I am trying to find out if it is possible to have different color palettes / themes for windows / user controls, so that each window / u-control has its own color theme.
From one of the developers in the material design xaml gitter chat:
as for changing the colors on different views. Yes. You can actually
take the same color resource dictionaries that you add in the App.xaml
(you only need the color ones; not all of them) and apply them at
whatever level in the XAML makes sense. For example if you wanted to
change the primary color to Blue for all controls inside of a Grid you
could do something like this:
<Grid>
<Grid.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/MaterialDesignColors;component/Themes/Recommended/Primary/MaterialDesignColor.Blue.xaml"/>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Grid.Resources>
</Grid>

How to set label color of livechart?

I have an application based on materialdesigninxaml framework where I can set the light and the dark color, when the light color is setted I can see correctly the label text which is black, but when I set the dark theme the label of the charts still remain black, so I don't see anything. This is my chart:
<lvc:CartesianChart Series="{Binding}" LegendLocation="Bottom">
<lvc:CartesianChart.AxisY>
<lvc:Axis Labels="{Binding AnalysisController.Labels}"/>
</lvc:CartesianChart.AxisY>
</lvc:CartesianChart>
I tried to add this to my App.xaml as suggested by the documentation:
<ResourceDictionary Source="pack://application:,,,/LiveCharts.Wpf;component/Themes/Colors/white.xaml" />
but the color of the text is still black
You can set the Foreground of your axis to another color like this:
<lvc:CartesianChart Series="{Binding}" LegendLocation="Bottom">
<lvc:CartesianChart.AxisY>
<lvc:Axis Labels="{Binding AnalysisController.Labels}"
Foreground="White"/>
</lvc:CartesianChart.AxisY>
</lvc:CartesianChart>

Mahapps Custom title bar color

Currently i am using <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Accents/BaseLight.xaml" />
And this is the result:
I also found this supported colors: https://github.com/MahApps/MahApps.Metro/tree/master/MahApps.Metro/Styles/Accents
But i cannot find the Gray color that i want to change into.
Any idea how to change to custom color ?
You can set the title brush to whatever you want by setting WindowTitleBrush="Chocolate"
<Controls:MetroWindow x:Class="MetroDemo.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:MetroDemo="clr-namespace:MetroDemo"
Title="MahApps.Metro - Demo Application"
WindowTitleBrush="Chocolate">
</Controls:MetroWindow>
Hope this helps!

How to change the Fluent Ribbon UI backstage color

How do I change the color of the Fluent Ribbon UI backstage menu which is – by default – blue?
You need to set the Backstage Background Color. This will update the MenuButton, BackstageTabItems and the swish in the corner of the backstage panel. Example below sets the color to Red.
<Fluent:Backstage Background="Red">
<Fluent:BackstageTabControl>
<Fluent:BackstageTabItem Header="New"/>
<Fluent:BackstageTabItem Header="Print"/>
</Fluent:BackstageTabControl>
</Fluent:Backstage>
Version 3.4.0: you can change the ribbon theme color using the MetroColors.ThemeColorKey property.
Put the following code in App.xaml file:
<Application.Resources>
<ResourceDictionary>
<!-- This "override" is needed to change the ribbon theme color, do not remove! -->
<Color x:Key="{x:Static fluent:MetroColors.ThemeColorKey}">#FFF66AC1</Color>
...
UPDATE
With Fluent.Ribbon version 9.0.4 only the MenuButton is updated when setting the Backstage Background property.
To update the BackstageTabControl ItemsPanel you have to set the BackstageTabControl ItemsPanelBackground property.
You can also set the BackstageTabControl Background which is also not updated wile setting the Backstage Background property.
<Fluent:Backstage Header="myHeader" Background="Red">
<Fluent:BackstageTabControl ItemsPanelBackground="Red" Background="Red">
<Fluent:Button Header="Preferences" Command="{Binding OpenPreferencesCommand}" />
<Fluent:BackstageTabItem Header="Print" />
<Fluent:Button Header="Blue" />
</Fluent:BackstageTabControl>
</Fluent:Backstage>

Resources