Fixed MapPath rendering

This commit is contained in:
ClemensFischer 2023-01-24 16:22:02 +01:00
parent 1ac9ee6b82
commit 29ffdc4420
5 changed files with 40 additions and 9 deletions

View file

@ -26,6 +26,10 @@ namespace MapControl
nameof(Locations), typeof(IEnumerable<Location>), typeof(MapPolygon),
new PropertyMetadata(null, (o, e) => ((MapPolygon)o).DataCollectionPropertyChanged(e)));
public static readonly DependencyProperty FillRuleProperty = DependencyProperty.Register(
nameof(FillRule), typeof(FillRule), typeof(MapPolygon),
new PropertyMetadata(FillRule.EvenOdd, (o, e) => ((PathGeometry)((MapPolygon)o).Data).FillRule = (FillRule)e.NewValue));
/// <summary>
/// Gets or sets the Locations that define the polygon points.
/// </summary>
@ -38,6 +42,12 @@ namespace MapControl
set => SetValue(LocationsProperty, value);
}
public FillRule FillRule
{
get => (FillRule)GetValue(FillRuleProperty);
set => SetValue(FillRuleProperty, value);
}
public MapPolygon()
{
Data = new PathGeometry();

View file

@ -26,6 +26,10 @@ namespace MapControl
nameof(Locations), typeof(IEnumerable<Location>), typeof(MapPolyline),
new PropertyMetadata(null, (o, e) => ((MapPolyline)o).DataCollectionPropertyChanged(e)));
public static readonly DependencyProperty FillRuleProperty = DependencyProperty.Register(
nameof(FillRule), typeof(FillRule), typeof(MapPolyline),
new PropertyMetadata(FillRule.EvenOdd, (o, e) => ((PathGeometry)((MapPolyline)o).Data).FillRule = (FillRule)e.NewValue));
/// <summary>
/// Gets or sets the Locations that define the polyline points.
/// </summary>
@ -38,6 +42,12 @@ namespace MapControl
set => SetValue(LocationsProperty, value);
}
public FillRule FillRule
{
get => (FillRule)GetValue(FillRuleProperty);
set => SetValue(FillRuleProperty, value);
}
public MapPolyline()
{
Data = new PathGeometry();