question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Brush using color as DynamicResource is not updated in preview 6

See original GitHub issue

Describe 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

Expected behavior The rectangle should become green (it’s working as expected in 0.10.x): expected

Actual behavior The rectangle background color doesn’t change in the latest changes on master. actual

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:closed
  • Created 5 months ago
  • Reactions:2
  • Comments:11 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
grokyscommented, Jun 15, 2023

Seems to have been fixed, tested in current master and the rectangle becomes green 🎂

0reactions
legistekcommented, Jun 20, 2023

Oh I am plenty familiar with that feeling. 😃. Got it thank you all!

Read more comments on GitHub >

github_iconTop Results From Across the Web

SolidColorBrushes as Dynamic Resources are not updating
I have a window with a number or Dynamic Resources for colors/brushes on it. For example this; EXAMPLE 1 DOES NOT UPDATE "DynamicResource...
Read more >
Custom UI Elements with Eto.Forms - Rhino Developer
I'm interested in learning more about the radial brush HUD element as I would like to add a radial/contextual menu to my own...
Read more >
Programming Windows Presentation Foundation
You might expect it to look like Example 6-10. Example 6-10. How not to use a system resource value this.Background = (Brush) this.FindResource(SystemColors ......
Read more >
Mastering Windows Presentation Foundation: Build responsive ...
Build responsive UIs for desktop applications with WPF, 2nd Edition Sheridan Yuen ... <SolidColorBrush x:Key="BackgroundBrush" Color="{StaticResource ...
Read more >
Foundations of WPF: An Introduction to Windows Presentation ...
Fill> </Ellipse> Figure 7-6 shows the results. ... For example, you can set a fill brush for a shape to use the same...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found