mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2025-12-06 07:12:04 +01:00
Avalonia InvalidateGeometry on new Path Figures
This commit is contained in:
parent
ddc11bcc8a
commit
e49ca0b79e
|
|
@ -2,6 +2,7 @@
|
|||
// Copyright © 2024 Clemens Fischer
|
||||
// Licensed under the Microsoft Public License (Ms-PL)
|
||||
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Controls.Shapes;
|
||||
using Avalonia.Media;
|
||||
using System.Collections;
|
||||
|
|
@ -66,6 +67,12 @@ namespace MapControl
|
|||
UpdateData();
|
||||
}
|
||||
|
||||
protected void SetPathFigures(PathFigures pathFigures)
|
||||
{
|
||||
((PathGeometry)Data).Figures = pathFigures;
|
||||
InvalidateGeometry();
|
||||
}
|
||||
|
||||
protected void AddPolylinePoints(PathFigures pathFigures, IEnumerable<Location> locations, double longitudeOffset, bool closed)
|
||||
{
|
||||
if (locations.Count() >= 2)
|
||||
|
|
|
|||
|
|
@ -57,10 +57,7 @@ namespace MapControl
|
|||
|
||||
protected override void UpdateData()
|
||||
{
|
||||
((PathGeometry)Data).Figures = GetPathFigures(Locations, true);
|
||||
#if AVALONIA
|
||||
InvalidateGeometry();
|
||||
#endif
|
||||
SetPathFigures(GetPathFigures(Locations, true));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -57,10 +57,7 @@ namespace MapControl
|
|||
|
||||
protected override void UpdateData()
|
||||
{
|
||||
((PathGeometry)Data).Figures = GetPathFigures(Locations, false);
|
||||
#if AVALONIA
|
||||
InvalidateGeometry();
|
||||
#endif
|
||||
SetPathFigures(GetPathFigures(Locations, true));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -84,6 +84,11 @@ namespace MapControl
|
|||
return true;
|
||||
}
|
||||
|
||||
protected void SetPathFigures(PathFigureCollection pathFigures)
|
||||
{
|
||||
((PathGeometry)Data).Figures = pathFigures;
|
||||
}
|
||||
|
||||
protected void AddPolylinePoints(PathFigureCollection pathFigures, IEnumerable<Location> locations, double longitudeOffset, bool closed)
|
||||
{
|
||||
if (locations.Count() >= 2)
|
||||
|
|
|
|||
|
|
@ -58,6 +58,11 @@ namespace MapControl
|
|||
UpdateData();
|
||||
}
|
||||
|
||||
protected void SetPathFigures(PathFigureCollection pathFigures)
|
||||
{
|
||||
((PathGeometry)Data).Figures = pathFigures;
|
||||
}
|
||||
|
||||
protected void AddPolylinePoints(PathFigureCollection pathFigures, IEnumerable<Location> locations, double longitudeOffset, bool closed)
|
||||
{
|
||||
if (locations.Count() >= 2)
|
||||
|
|
|
|||
Loading…
Reference in a new issue