Closed bebenins closed 3 years ago
This was broken by the breaking change in #2080
[Dragablz is making the assumption that SecondaryAccentBrush will be defined] (https://github.com/ButchersBoy/Dragablz/blob/da7a4e58e1986b59fade3805f3777e6acb3e8fc5/Dragablz/Themes/MaterialDesign.xaml#L152) but this brush was renamed to SecondaryHueMidBrush
.
I checked in a sample to the Dragablz demo app to show how to work around the issue since I suspect there will be other occurrences with changing brush names where this example will help people.
The code looks like this in your App.xaml.cs
public partial class App : Application
{
protected override void OnStartup(StartupEventArgs e)
{
base.OnStartup(e);
//Add/Update brush used by Dragablz when the theme changes
//Solution for https://github.com/MaterialDesignInXAML/MaterialDesignInXamlToolkit/issues/2349
PaletteHelper helper = new PaletteHelper();
if (helper.GetThemeManager() is { } themeManager)
{
themeManager.ThemeChanged += ThemeManager_ThemeChanged;
}
}
private void ThemeManager_ThemeChanged(object? sender, ThemeChangedEventArgs e)
{
Resources["SecondaryAccentBrush"] = new SolidColorBrush(e.NewTheme.SecondaryMid.Color);
}
}
Demo app
My app (new vs old)
My previous DLLs are year old so I can't tell where it broke.