You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When loading a Style Axaml using the AvaloniaRuntimeLoader, any dynamic resource declared that is not in the style (a.k.a. loaded from either window resource or app resources) are resolved to null. The same axaml, if compiled works fine.
This is easily observed with a TemplatedControl being populated by a style.
Describe the bug
When loading a Style Axaml using the AvaloniaRuntimeLoader, any dynamic resource declared that is not in the style (a.k.a. loaded from either window resource or app resources) are resolved to null. The same axaml, if compiled works fine.
This is easily observed with a TemplatedControl being populated by a style.
To Reproduce
I added a small example to reproduce it: https://github.com/racerxdl/TemplatedControlLoadBug
There are two buttons that does a different workflow:
Click me for the bug
- Loads the custom control using AxamlRuntimeLoader, and then loads the style and replaces it. The image does not appear.Click me for no bug
- Loads the exact same custom control, but let the pre-compiled style to load it. The image appears.The style axamls are identical. Just the loading method is different.
Bugged:
Not bugged:
Expected behavior
Both methods should work.
Avalonia version
11.0.6
OS
Windows
Additional context
No response
The text was updated successfully, but these errors were encountered: