Brush using color as DynamicResource is not updated in preview 6
See original GitHub issueDescribe the bug Our theming mechanism is not working as expected in Avalonia 11. It was working fine in 0.10.x.
I was able to reproduce it in a minimal application (it works as expected for 0.10.x
but not for preview 6
).
The way we are using styles is quite simple. We define the colors as style sets:
And then, we define the brushes (Brushes.xaml) using the colors as DynamicResources
To change the theme, we load the colors in the appropriate styles slot: https://github.com/danipen/AvaloniaCanvasTest/blob/e953751576e8816b3491ec15ec5472a9965c0055/AvaloniaCanvasTest/MainWindow.axaml.cs#L27
To Reproduce
- Open the minimal sample: https://github.com/danipen/AvaloniaCanvasTest
- Click the “Change background color” button.
Expected behavior
The rectangle should become green (it’s working as expected in 0.10.x
):
Actual behavior The rectangle background color doesn’t change in the latest changes on master.
Desktop (please complete the following information):
- OS: Windows
- Version latest master
Additional context
Note that we’re not using the ThemeVariants
or the ControlThemes
yet, that probably fits better for this purpose. Note that when we started our project those features were not available. We will try to upgrade to use that sometime when we can.
In the meantime, if this bug can be addressed it would fix 99% percent of our current theming issues in preview 6.
Issue Analytics
- State:
- Created 5 months ago
- Reactions:2
- Comments:11 (7 by maintainers)
Top GitHub Comments
Seems to have been fixed, tested in current master and the rectangle becomes green 🎂
Oh I am plenty familiar with that feeling. 😃. Got it thank you all!