This repository has been archived by the owner on May 1, 2024. It is now read-only.
Detect Points changes in Xamarin.Forms.Shapes.Polyline #11848
Labels
a/brushes
blocker
Issue blocks next stable release. Prioritize fixing and reviewing this issue.
e/2 🕑
2
in-progress
This issue has an associated pull request that may resolve it!
t/bug 🐛
Projects
Milestone
This issue has been moved from a ticket on Developer Community.
[severity:I'm frustrated, but able to complete my work]
Xamarin.Forms.Shapes.Polyline.Points doesn't respond to CollectionChanged events.
I bound the property Points of Polyline to my own PointCollection and when changing the points in the PointCollection the UI does not update the drawing with the new points. Even recreating a new PointCollection does not change the UI.
When I change the Xaml to use a Polygon instead of a Polyline everything works fine in Xamarin Forms 4.8.
This issue has been fixed in Xamarin Forms 4.8 for Polygon according to GitHub, and seems to work.
However, the issue still exist for Polyline. I even tried Xamarin Forms 5.0.1.1276-nightly and the issue is still there.
This is what I saw on GitHub
PolygonRenderer.cs Detect Points changes in Polygon (#11576) 12 days ago
PolylineRenderer.cs [Enhancement] Shapes (#9218) 2 months ago
Is there a plan to fix it for Polyline and when?
Original Comments
Denis Ruffo on 8/10/2020, 08:33 PM:
Polygon does update, however it would crash depending when the Point collection is updated.
because the PolygoneRenderer call for each platform (UWP, iOS, Android) the Method UpdatePoints without checking if Element is null. It is actually null for a while until not.
Feedback Bot on 8/11/2020, 01:47 AM:
We have directed your feedback to the appropriate engineering team for further evaluation. The team will review the feedback and notify you about the next steps.
Denis Ruffo on 8/11/2020, 02:29 PM:
In addition the previous issue.
if I have the following in my XAML
The height of the display is scaled to the the biggest height when DataPoints was first created so if DataPoints has values with small amplitude and was originally initialized to small values like below
private PointCollection _dataPoints = new PointCollection();
for (int x = 0; x < 100; x++)
{ DataPoints.Add(new Point(x, 0)); }
and then later I have DataPoints with Amplitude of 100, none of the data point would plot.
for (int x = 0; x < 100; x++)
{ DataPoints.Add(new Point(x, 100)); }
The only way I was able to fix it was to initialize DataPoints with the biggest amplitude possible
Original Solutions
(no solutions)
The text was updated successfully, but these errors were encountered: