-
-
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
Changing color of SolidColorBrush don't cause a rerender #11673
Comments
Probably related (or duplicated) to #11036. |
Yes, i think it related to your issue, @danipen But i facing this issue only for rc1-1, not for preview*. I should check it again. |
if you change the code like this private void Button_OnClick(object? sender, RoutedEventArgs e)
{
var random = new Random();
App.Current!.Resources["MyBrush"] = new SolidColorBrush()
{
Color = Color.FromRgb((byte)random.Next(0, 255), (byte)random.Next(0, 255), (byte)random.Next(0, 255))
};
} works. |
Yep, I know this. But this is not a solution for me (I have a smooth transition between colors in Material.Avalonia) |
I think it's more related to this #11640 one and was already fixed in master. |
@maxkatz6 I've tried the |
Seems like this issue strikes back in AvaloniaCommunity/Material.Avalonia#262 Update for Avalonia 11.0.0: still reproduceable as in my last comment. Here is an updated code: AvaloniaApplication1.zip But i figured out some interesting details, if we put a control with a explicit binding after the button, button color changing start working. <StackPanel>
<Button Foreground="{DynamicResource MyBrush}" Click="Button_OnClick">CHANGE COLOR</Button>
<Button Foreground="{DynamicResource MyBrush}">DUMMY</Button>
<TextBlock Foreground="{DynamicResource MyBrush}">TEST TEXT</TextBlock>
</StackPanel> But, if we put another button in the end 😆, it doesn't work: <StackPanel>
<Button Foreground="{DynamicResource MyBrush}" Click="Button_OnClick">CHANGE COLOR</Button>
<Button Foreground="{DynamicResource MyBrush}">DUMMY</Button>
<TextBlock Foreground="{DynamicResource MyBrush}">TEST TEXT</TextBlock>
<Button Foreground="{DynamicResource MyBrush}">DUMMY</Button>
</StackPanel> @kekekeks, @maxkatz6 i think what it's something compositor related, do you think? |
Hmm, this case is actually resolved, but textboxes in Material.Avalonia still experiencing this issue. I think i need to create another repro. |
Describe the bug
When i change
Color
property ofSolidColorBrush
in resources it doesn't cause a rerender. It works in 11-preview*, but doesn't work in rc1-1To Reproduce
Steps to reproduce the behavior:
Desktop (please complete the following information):
Fast repro (also contains my other code, don't mind):
AvaloniaApplication1.zip
The text was updated successfully, but these errors were encountered: