Issue with MahApps styling + Backstage
See original GitHub issueHi,
Firstly, thank you for creating this great project, it’s really good.
At the moment we have solved most of our outstanding issues but one. We are trying to theme things programmatically to be in sync with MahApps but have come across an issue. The issue is basically that if we programmatically set a custom accent colour, when opening the Backstage/BackstageTabControl, not all of the styling works (some things are not styles, buttons have no mouse over effect, etc.
Using MahApps, we are doing the following. it works and styles the Fluent.Ribbon correctly.
protected override void OnStartup(StartupEventArgs e)
{
base.OnStartup(e);
var theme = new Theme("MahAppsRoyalDark", "MahAppsRoyalDark", ThemeManager.BaseColorDark, "Red", Colors.MediumPurple, Brushes.MediumPurple, true, false);
ThemeManager.Current.ChangeTheme(this, theme);
}
The problem we’ve got is that we do not want to use one of the standard Microsoft colours but wish instead to provide our own.
protected override void OnStartup(StartupEventArgs e)
{
base.OnStartup(e);
var customColor = new Color
{
R = 116,
G = 70,
B = 185
};
var theme = new Theme("MahAppsRoyalDark", "MahAppsRoyalDark", ThemeManager.BaseColorDark, "Red", customColor, new SolidColorBrush(customColor), true, false);
ThemeManager.Current.ChangeTheme(this, theme);
}
This time this sort of works, but the behaviour is a little unexpected, with the styling partially applied (the button mouse hovering etc. does not work as expected). TLDR; if I use a standard Microsoft colour to change the theme accent, all is ok. If I use my own, it isn’t.
By any chance have you come across this issue before? Is it something I’m doing incorrectly?
Thanks in advance.
Environment
- Fluent.Ribbon 9.0.4
- Windows 10 21H1
- .NET 6
Issue Analytics
- State:
- Created a year ago
- Comments:5 (3 by maintainers)
Top GitHub Comments
You are welcome.
Brilliant thanks @batzen it works now!