2024-05-25 18:58:51 +02:00
|
|
|
|
// XAML Map Control - https://github.com/ClemensFischer/XAML-Map-Control
|
|
|
|
|
|
// Copyright © 2024 Clemens Fischer
|
|
|
|
|
|
// Licensed under the Microsoft Public License (Ms-PL)
|
|
|
|
|
|
|
|
|
|
|
|
namespace MapControl
|
|
|
|
|
|
{
|
|
|
|
|
|
public partial class MapPath : Shape
|
|
|
|
|
|
{
|
|
|
|
|
|
public MapPath()
|
|
|
|
|
|
{
|
|
|
|
|
|
Stretch = Stretch.None;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public static readonly StyledProperty<Geometry> DataProperty =
|
2024-05-26 20:32:29 +02:00
|
|
|
|
DependencyPropertyHelper.AddOwner<MapPath, Geometry>(Path.DataProperty, null,
|
2024-05-25 23:03:40 +02:00
|
|
|
|
(path, oldValue, newValue) => path.UpdateData());
|
2024-05-25 18:58:51 +02:00
|
|
|
|
|
|
|
|
|
|
public Geometry Data
|
|
|
|
|
|
{
|
|
|
|
|
|
get => GetValue(DataProperty);
|
|
|
|
|
|
set => SetValue(DataProperty, value);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
protected override Geometry CreateDefiningGeometry() => Data;
|
|
|
|
|
|
|
|
|
|
|
|
private void SetMapTransform(Matrix matrix)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (Data.Transform is MatrixTransform transform)
|
|
|
|
|
|
{
|
|
|
|
|
|
transform.Matrix = matrix;
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
Data.Transform = new MatrixTransform(matrix);
|
|
|
|
|
|
}
|
2024-05-25 19:35:26 +02:00
|
|
|
|
|
|
|
|
|
|
InvalidateVisual();
|
2024-05-25 18:58:51 +02:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|