Skip to content

There is some way to overwrite the MaterialDesignPaper brush #3082

Closed Answered by Keboo
OrlandoNatsu asked this question in Q&A
Discussion options

You must be logged in to vote

Yes, this is something that is getting a major re-work done for the 5.0.0 release.

For now the easiest way to do it is to get a hold of the ITheme instance, modify the brush, and save the change. The basic code looks like this:

var paletteHelper = new PaletteHelper();
ITheme theme = paletteHelper.GetTheme();
theme.Paper = Colors.Fuchsia;
paletteHelper.SetTheme(theme);

If you let the theme change from user to user you can use the IThemeManager to be notified when the theme changes and update the brush. Something like this:

var paletteHelper = new PaletteHelper();
IThemeManager manager = paletteHelper.GetThemeManager();
manager.ThemeChanged += OnThemeChanged;

UpdateBrushes();

void OnThem…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@OrlandoNatsu
Comment options

@Keboo
Comment options

Answer selected by OrlandoNatsu
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants