Updated MapContentControl, MapItem, MapPath

This commit is contained in:
ClemensFischer 2026-02-02 12:10:09 +01:00
parent 2dc7431c25
commit 7cfb80520b
18 changed files with 216 additions and 133 deletions

View file

@ -6,12 +6,9 @@ namespace MapControl
{
public partial class MapPath : Shape
{
public static readonly StyledProperty<Geometry> DataProperty = Path.DataProperty.AddOwner<MapPath>();
static MapPath()
{
DataProperty.Changed.AddClassHandler<MapPath, Geometry>((path, e) => path.UpdateData());
}
public static readonly StyledProperty<Geometry> DataProperty =
DependencyPropertyHelper.AddOwner<MapPath, Geometry>(Path.DataProperty,
(path, oldValue, newValue) => path.UpdateData());
public Geometry Data
{
@ -20,17 +17,5 @@ namespace MapControl
}
protected override Geometry CreateDefiningGeometry() => Data;
private void SetDataTransform(Matrix matrix)
{
if (Data.Transform is MatrixTransform transform)
{
transform.Matrix = matrix;
}
else
{
Data.Transform = new MatrixTransform(matrix);
}
}
}
}