Skip to content
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 properties of Shape.Stroke brush does not update app rendering #13891

Closed
etvorun opened this issue Mar 13, 2023 · 1 comment · Fixed by #13905
Closed

Changing properties of Shape.Stroke brush does not update app rendering #13891

etvorun opened this issue Mar 13, 2023 · 1 comment · Fixed by #13905
Assignees
Labels
area-drawing Shapes, Borders, Shadows, Graphics, BoxView, custom drawing fixed-in-8.0.0-preview.3.8149 Look for this fix in 8.0.0-preview.3.8149! platform/windows 🪟 t/bug Something isn't working

Comments

@etvorun
Copy link
Contributor

etvorun commented Mar 13, 2023

Description

Changing Shape.Stroke does not update app rendering

Steps to Reproduce

  1. Create new MAUI app.
  2. Set Windows as target platform.
  3. Open MainPage.xaml and replace content of <ContentPage> element with
  <VerticalStackLayout>
    <Button x:Name="MyButton" Text="Change color" Margin="4" HorizontalOptions="Start"/>
    <Line x:Name="MyLine" X1="0" X2="150" StrokeThickness="4" HorizontalOptions="Start"/>
  </VerticalStackLayout>
  1. Open MainPage.xaml.cs and replace implementation with
public partial class MainPage : ContentPage
{
	SolidColorBrush brush;
	Color[] colors = { Colors.Green, Colors.Red, Colors.Blue };
	int colorIndex = -1;

	public MainPage()
	{
		InitializeComponent();
		brush = new SolidColorBrush();
		UpdateBrushColor();

        // Use same brush for Button and Line
		MyLine.Stroke = brush;
        MyButton.Background = brush;
        MyButton.Clicked += (s, e) => UpdateBrushColor();
    }

	void UpdateBrushColor()
	{
		if (++colorIndex >= colors.Length)
			colorIndex = 0;

		brush.Color = colors[colorIndex];
	}
}
  1. Build and run
  2. Click "Change color" button few times.
    Expected: both button and line will change colors.
    Actual: only button changes color.

Link to public reproduction project repository

n/a

Version with bug

7.0 (current)

Last version that worked well

Unknown/Other

Affected platforms

Windows, I was not able test on other platforms

Affected platform versions

Win 22H2

Did you find any workaround?

No response

Relevant log output

No response

@etvorun etvorun added the t/bug Something isn't working label Mar 13, 2023
@etvorun etvorun changed the title Changing Shape.Stroke does not update app rendering Changing properties of Shape.Stroke brush does not update app rendering Mar 13, 2023
@jsuarezruiz jsuarezruiz added platform/windows 🪟 area-drawing Shapes, Borders, Shadows, Graphics, BoxView, custom drawing labels Mar 14, 2023
@jsuarezruiz jsuarezruiz self-assigned this Mar 14, 2023
@jsuarezruiz jsuarezruiz added this to the Backlog milestone Mar 14, 2023
@ghost
Copy link

ghost commented Mar 14, 2023

We've added this issue to our backlog, and we will work to address it as time and resources allow. If you have any additional information or questions about this issue, please leave a comment. For additional info about issue management, please read our Triage Process.

@jsuarezruiz jsuarezruiz moved this to In Progress in MAUI SDK Ongoing Mar 14, 2023
@github-project-automation github-project-automation bot moved this from In Progress to Done in MAUI SDK Ongoing Mar 21, 2023
@samhouts samhouts added the fixed-in-8.0.0-preview.3.8149 Look for this fix in 8.0.0-preview.3.8149! label Apr 12, 2023
@ghost ghost locked as resolved and limited conversation to collaborators May 12, 2023
@samhouts samhouts modified the milestones: Backlog, .NET 8 May 24, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-drawing Shapes, Borders, Shadows, Graphics, BoxView, custom drawing fixed-in-8.0.0-preview.3.8149 Look for this fix in 8.0.0-preview.3.8149! platform/windows 🪟 t/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants