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

Shape / Geometries Bindable Properties not working #8530

Closed
epsmae opened this issue Jul 5, 2022 · 1 comment · Fixed by #8533
Closed

Shape / Geometries Bindable Properties not working #8530

epsmae opened this issue Jul 5, 2022 · 1 comment · Fixed by #8533
Assignees
Labels
area-drawing Shapes, Borders, Shadows, Graphics, BoxView, custom drawing s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working
Milestone

Comments

@epsmae
Copy link

epsmae commented Jul 5, 2022

Description

The properties of shapes can only be set in xaml they do not work if changed from code behind or from a view model.
Accoring to the documentation this should work:

These properties are backed by BindableProperty objects, which means that they can be targets of data bindings, and styled.

Steps to Reproduce

  1. dotnet new maui
  2. Add LineSegments and ArcSegment to MainPage.xaml
         <Path Stroke="Black"      
                  Aspect="Uniform"
                  HorizontalOptions="Start">
                <Path.Data>
                    <PathGeometry>
                        <PathGeometry.Figures>
                            <PathFigureCollection>
                                <PathFigure x:Name="LineSegments" IsClosed="True"
                                StartPoint="10,100">
                                    <PathFigure.Segments>
                                        <PathSegmentCollection>
                                            <LineSegment Point="100,100" />
                                            <LineSegment Point="100,50" />
                                        </PathSegmentCollection>
                                    </PathFigure.Segments>
                                </PathFigure>
                            </PathFigureCollection>
                        </PathGeometry.Figures>
                    </PathGeometry>
                </Path.Data>
            </Path>

            <Path Stroke="Black">
                <Path.Data>
                    <PathGeometry>
                        <PathGeometry.Figures>
                            <PathFigureCollection>
                                <PathFigure StartPoint="10,10">
                                    <PathFigure.Segments>
                                        <PathSegmentCollection>
                                            <ArcSegment  x:Name="Arc" Size="100,50"
                                            RotationAngle="45"
                                            IsLargeArc="True"
                                            SweepDirection="CounterClockwise"
                                            Point="200,100" />
                                        </PathSegmentCollection>
                                    </PathFigure.Segments>
                                </PathFigure>
                            </PathFigureCollection>
                        </PathGeometry.Figures>
                    </PathGeometry>
                </Path.Data>
            </Path>
  1. Add code in MainPage.xaml button click handler to change the properties
        private void OnCounterClicked(object sender, EventArgs e)
	{
		count++;

		if (count == 1)
			CounterBtn.Text = $"Clicked {count} time";
		else
			CounterBtn.Text = $"Clicked {count} times";

		Arc.RotationAngle += 0.1;

		Arc.IsLargeArc = !Arc.IsLargeArc;

		Arc.Point = new Point(10, 10);

		LineSegments.IsClosed = !LineSegments.IsClosed;
                LineSegments.IsFilled = !LineSegments.IsFilled;

               SemanticScreenReader.Announce(CounterBtn.Text);
	}
  1. Deploy to android/iOS or Windows device and click on button
    Note one difference on Windows: OnButtonPress the ArcView gets invisible, probably a different error

Version with bug

6.0.400 (current)

Last version that worked well

Unknown/Other

Affected platforms

iOS, Android, Windows

Affected platform versions

iOS 15.5, Android12

Did you find any workaround?

No

Relevant log output

No response

@epsmae epsmae added s/needs-verification Indicates that this issue needs initial verification before further triage will happen t/bug Something isn't working labels Jul 5, 2022
@jsuarezruiz jsuarezruiz added the area-drawing Shapes, Borders, Shadows, Graphics, BoxView, custom drawing label Jul 5, 2022
@jsuarezruiz jsuarezruiz self-assigned this Jul 5, 2022
@jfversluis jfversluis removed the s/needs-verification Indicates that this issue needs initial verification before further triage will happen label Jul 5, 2022
@jsuarezruiz jsuarezruiz added s/verified Verified / Reproducible Issue ready for Engineering Triage s/triaged Issue has been reviewed labels Jul 5, 2022
@jsuarezruiz jsuarezruiz added this to the 6.0.300 milestone Jul 5, 2022
@jsuarezruiz
Copy link
Contributor

Thanks for the feedback. The issue will be fixed by #8533

@PureWeen PureWeen modified the milestones: 6.0.300, 6.0-sr5 Jul 27, 2022
@ghost ghost locked as resolved and limited conversation to collaborators Aug 26, 2022
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 s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants