-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rectangle doesn't rerender when Stroke's DynamicResource SolidColorBrush changes #12408
Comments
Additional info: when we have different ThemeDictionaries with target brush, switching between them works fine for Rectangle.Stroke. But issue still valid and plenty of people searched for fix in Material.Avalonia. |
Seems like this is affects Original issue about Also, I've updated an repro and put it into a git repository: https://github.com/SKProCH/AvaloniaBugsRepros ( Animation.mp4 |
@kekekeks seems like i found a root cause of this problem. As far as I know, Render method now only define how the control should be rendered by composition renderer, since it called once and other brushes updates do not call the Render method (but control actually re-rendered when If we look at the code for rendering Shape: Avalonia/src/Avalonia.Controls/Shapes/Shape.cs Lines 217 to 225 in 63a5bcc
We pass the So, if we change it to: pen = new Pen(
stroke,
StrokeThickness,
dashStyle,
StrokeLineCap,
StrokeJoin);
}
context.DrawGeometry(Fill, pen, geometry); everything start works properly. |
Fixed in master branch - |
Describe the bug
When i change color of SolidColorBrush, which bind with DynamicResource to Rectangle's Stroke, then Rectangle doesn't rerender.
To Reproduce
Steps to reproduce the behavior:
Repro project: AvaloniaApplication1.zip
Expected behavior
Rectangle should rerender when Stroke SolidColorBrush Color changed
Screenshots
3af0a3e9-665a-4e66-88d6-65d447ab4dee.mp4
Desktop (please complete the following information):
Additional context
Rectangle.Fill property working fine.
Also related to #11673
The text was updated successfully, but these errors were encountered: