diff --git a/MapControl/Avalonia/DependencyPropertyHelper.Avalonia.cs b/MapControl/Avalonia/DependencyPropertyHelper.Avalonia.cs index a65b37d4..b8178130 100644 --- a/MapControl/Avalonia/DependencyPropertyHelper.Avalonia.cs +++ b/MapControl/Avalonia/DependencyPropertyHelper.Avalonia.cs @@ -11,9 +11,9 @@ namespace MapControl public static StyledProperty Register( string name, TValue defaultValue = default, - bool bindTwoWayByDefault = false, Action changed = null, - Func coerce = null) + Func coerce = null, + bool bindTwoWayByDefault = false) where TOwner : AvaloniaObject { var property = AvaloniaProperty.Register(name, defaultValue, false, diff --git a/MapControl/Avalonia/MapBase.Avalonia.cs b/MapControl/Avalonia/MapBase.Avalonia.cs index db51435d..a24776e9 100644 --- a/MapControl/Avalonia/MapBase.Avalonia.cs +++ b/MapControl/Avalonia/MapBase.Avalonia.cs @@ -18,44 +18,50 @@ namespace MapControl DependencyPropertyHelper.Register(nameof(AnimationEasing), new QuadraticEaseOut()); public static readonly StyledProperty CenterProperty = - DependencyPropertyHelper.Register(nameof(Center), new Location(), true, + DependencyPropertyHelper.Register(nameof(Center), new Location(), (map, oldValue, newValue) => map.CenterPropertyChanged(newValue), - (map, value) => map.CoerceCenterProperty(value)); + (map, value) => map.CoerceCenterProperty(value), + true); public static readonly StyledProperty TargetCenterProperty = - DependencyPropertyHelper.Register(nameof(TargetCenter), new Location(), true, + DependencyPropertyHelper.Register(nameof(TargetCenter), new Location(), async (map, oldValue, newValue) => await map.TargetCenterPropertyChanged(newValue), - (map, value) => map.CoerceCenterProperty(value)); + (map, value) => map.CoerceCenterProperty(value), + true); public static readonly StyledProperty MinZoomLevelProperty = - DependencyPropertyHelper.Register(nameof(MinZoomLevel), 1d, false, + DependencyPropertyHelper.Register(nameof(MinZoomLevel), 1d, (map, oldValue, newValue) => map.MinZoomLevelPropertyChanged(newValue), (map, value) => map.CoerceMinZoomLevelProperty(value)); public static readonly StyledProperty MaxZoomLevelProperty = - DependencyPropertyHelper.Register(nameof(MaxZoomLevel), 20d, false, + DependencyPropertyHelper.Register(nameof(MaxZoomLevel), 20d, (map, oldValue, newValue) => map.MaxZoomLevelPropertyChanged(newValue), (map, value) => map.CoerceMaxZoomLevelProperty(value)); public static readonly StyledProperty ZoomLevelProperty = - DependencyPropertyHelper.Register(nameof(ZoomLevel), 1d, true, + DependencyPropertyHelper.Register(nameof(ZoomLevel), 1d, (map, oldValue, newValue) => map.ZoomLevelPropertyChanged(newValue), - (map, value) => map.CoerceZoomLevelProperty(value)); + (map, value) => map.CoerceZoomLevelProperty(value), + true); public static readonly StyledProperty TargetZoomLevelProperty = - DependencyPropertyHelper.Register(nameof(TargetZoomLevel), 1d, true, + DependencyPropertyHelper.Register(nameof(TargetZoomLevel), 1d, async (map, oldValue, newValue) => await map.TargetZoomLevelPropertyChanged(newValue), - (map, value) => map.CoerceZoomLevelProperty(value)); + (map, value) => map.CoerceZoomLevelProperty(value), + true); public static readonly StyledProperty HeadingProperty = - DependencyPropertyHelper.Register(nameof(Heading), 0d, true, + DependencyPropertyHelper.Register(nameof(Heading), 0d, (map, oldValue, newValue) => map.HeadingPropertyChanged(newValue), - (map, value) => map.CoerceHeadingProperty(value)); + (map, value) => map.CoerceHeadingProperty(value), + true); public static readonly StyledProperty TargetHeadingProperty = - DependencyPropertyHelper.Register(nameof(TargetHeading), 0d, true, + DependencyPropertyHelper.Register(nameof(TargetHeading), 0d, async (map, oldValue, newValue) => await map.TargetHeadingPropertyChanged(newValue), - (map, value) => map.CoerceHeadingProperty(value)); + (map, value) => map.CoerceHeadingProperty(value), + true); public static readonly DirectProperty ViewScaleProperty = AvaloniaProperty.RegisterDirect(nameof(ViewScale), map => map.ViewTransform.Scale); diff --git a/MapControl/Shared/GeoImage.cs b/MapControl/Shared/GeoImage.cs index e7cfb2b7..20be1b5b 100644 --- a/MapControl/Shared/GeoImage.cs +++ b/MapControl/Shared/GeoImage.cs @@ -52,7 +52,7 @@ namespace MapControl private static string QueryString(ushort tag) => $"/ifd/{{ushort={tag}}}"; public static readonly DependencyProperty SourcePathProperty = - DependencyPropertyHelper.Register(nameof(SourcePath), null, false, + DependencyPropertyHelper.Register(nameof(SourcePath), null, async (image, oldValue, newValue) => await image.SourcePathPropertyChanged(newValue)); public GeoImage() diff --git a/MapControl/Shared/GroundOverlay.cs b/MapControl/Shared/GroundOverlay.cs index 00b2aae7..5383f72e 100644 --- a/MapControl/Shared/GroundOverlay.cs +++ b/MapControl/Shared/GroundOverlay.cs @@ -62,7 +62,7 @@ namespace MapControl } public static readonly DependencyProperty SourcePathProperty = - DependencyPropertyHelper.Register(nameof(SourcePath), null, false, + DependencyPropertyHelper.Register(nameof(SourcePath), null, async (overlay, oldValue, newValue) => await overlay.SourcePathPropertyChanged(newValue)); public string SourcePath diff --git a/MapControl/Shared/MapBase.cs b/MapControl/Shared/MapBase.cs index 999ac1a4..fa85acb6 100644 --- a/MapControl/Shared/MapBase.cs +++ b/MapControl/Shared/MapBase.cs @@ -46,15 +46,15 @@ namespace MapControl DependencyPropertyHelper.Register(nameof(AnimationDuration), TimeSpan.FromSeconds(0.3)); public static readonly DependencyProperty MapLayerProperty = - DependencyPropertyHelper.Register(nameof(MapLayer), null, false, + DependencyPropertyHelper.Register(nameof(MapLayer), null, (map, oldValue, newValue) => map.MapLayerPropertyChanged(oldValue, newValue)); public static readonly DependencyProperty MapProjectionProperty = - DependencyPropertyHelper.Register(nameof(MapProjection), new WebMercatorProjection(), false, + DependencyPropertyHelper.Register(nameof(MapProjection), new WebMercatorProjection(), (map, oldValue, newValue) => map.MapProjectionPropertyChanged(newValue)); public static readonly DependencyProperty ProjectionCenterProperty = - DependencyPropertyHelper.Register(nameof(ProjectionCenter), null, false, + DependencyPropertyHelper.Register(nameof(ProjectionCenter), null, (map, oldValue, newValue) => map.ProjectionCenterPropertyChanged()); private Location transformCenter; diff --git a/MapControl/Shared/MapImageLayer.cs b/MapControl/Shared/MapImageLayer.cs index 884e0b8f..caf2cb48 100644 --- a/MapControl/Shared/MapImageLayer.cs +++ b/MapControl/Shared/MapImageLayer.cs @@ -44,7 +44,7 @@ namespace MapControl public static readonly DependencyProperty UpdateIntervalProperty = DependencyPropertyHelper.Register(nameof(UpdateInterval), TimeSpan.FromSeconds(0.2), - false, (layer, oldValue, newValue) => layer.updateTimer.Interval = newValue); + (layer, oldValue, newValue) => layer.updateTimer.Interval = newValue); public static readonly DependencyProperty UpdateWhileViewportChangingProperty = DependencyPropertyHelper.Register(nameof(UpdateWhileViewportChanging)); diff --git a/MapControl/Shared/MapPath.cs b/MapControl/Shared/MapPath.cs index 684b7800..1f8f5732 100644 --- a/MapControl/Shared/MapPath.cs +++ b/MapControl/Shared/MapPath.cs @@ -24,7 +24,7 @@ namespace MapControl public partial class MapPath : IMapElement { public static readonly DependencyProperty LocationProperty = - DependencyPropertyHelper.Register(nameof(Location), null, false, + DependencyPropertyHelper.Register(nameof(Location), null, (path, oldValue, newValue) => path.UpdateData()); private MapBase parentMap; diff --git a/MapControl/Shared/MapPolygon.cs b/MapControl/Shared/MapPolygon.cs index 3737a2e6..b1face46 100644 --- a/MapControl/Shared/MapPolygon.cs +++ b/MapControl/Shared/MapPolygon.cs @@ -22,11 +22,11 @@ namespace MapControl public class MapPolygon : MapPath { public static readonly DependencyProperty LocationsProperty = - DependencyPropertyHelper.Register>(nameof(Locations), null, false, + DependencyPropertyHelper.Register>(nameof(Locations), null, (polygon, oldValue, newValue) => polygon.DataCollectionPropertyChanged(oldValue, newValue)); public static readonly DependencyProperty FillRuleProperty = - DependencyPropertyHelper.Register(nameof(FillRule), FillRule.EvenOdd, false, + DependencyPropertyHelper.Register(nameof(FillRule), FillRule.EvenOdd, (polygon, oldValue, newValue) => ((PathGeometry)polygon.Data).FillRule = newValue); /// diff --git a/MapControl/Shared/MapPolyline.cs b/MapControl/Shared/MapPolyline.cs index f653e9c6..23d1dae7 100644 --- a/MapControl/Shared/MapPolyline.cs +++ b/MapControl/Shared/MapPolyline.cs @@ -22,11 +22,11 @@ namespace MapControl public class MapPolyline : MapPath { public static readonly DependencyProperty LocationsProperty = - DependencyPropertyHelper.Register>(nameof(Locations), null, false, + DependencyPropertyHelper.Register>(nameof(Locations), null, (polyline, oldValue, newValue) => polyline.DataCollectionPropertyChanged(oldValue, newValue)); public static readonly DependencyProperty FillRuleProperty = - DependencyPropertyHelper.Register(nameof(FillRule), FillRule.EvenOdd, false, + DependencyPropertyHelper.Register(nameof(FillRule), FillRule.EvenOdd, (polyline, oldValue, newValue) => ((PathGeometry)polyline.Data).FillRule = newValue); /// diff --git a/MapControl/Shared/MapTileLayerBase.cs b/MapControl/Shared/MapTileLayerBase.cs index e2aa841f..66b66055 100644 --- a/MapControl/Shared/MapTileLayerBase.cs +++ b/MapControl/Shared/MapTileLayerBase.cs @@ -31,7 +31,7 @@ namespace MapControl public abstract partial class MapTileLayerBase : Panel, IMapLayer { public static readonly DependencyProperty TileSourceProperty = - DependencyPropertyHelper.Register(nameof(TileSource), null, false, + DependencyPropertyHelper.Register(nameof(TileSource), null, async (layer, oldValue, newValue) => await layer.Update(true)); public static readonly DependencyProperty SourceNameProperty = diff --git a/MapControl/Shared/WmsImageLayer.cs b/MapControl/Shared/WmsImageLayer.cs index 2c7ef8c6..80b3d019 100644 --- a/MapControl/Shared/WmsImageLayer.cs +++ b/MapControl/Shared/WmsImageLayer.cs @@ -30,11 +30,15 @@ namespace MapControl public partial class WmsImageLayer : MapImageLayer { public static readonly DependencyProperty ServiceUriProperty = - DependencyPropertyHelper.Register(nameof(ServiceUri), null, false, + DependencyPropertyHelper.Register(nameof(ServiceUri), null, + async (layer, oldValue, newValue) => await layer.UpdateImageAsync()); + + public static readonly DependencyProperty WmsStylesProperty = + DependencyPropertyHelper.Register(nameof(WmsStyles), string.Empty, async (layer, oldValue, newValue) => await layer.UpdateImageAsync()); public static readonly DependencyProperty WmsLayersProperty = - DependencyPropertyHelper.Register(nameof(WmsLayers), null, false, + DependencyPropertyHelper.Register(nameof(WmsLayers), null, async (layer, oldValue, newValue) => { // Ignore property change from GetImageAsync when Layers was null. @@ -45,10 +49,6 @@ namespace MapControl } }); - public static readonly DependencyProperty WmsStylesProperty = - DependencyPropertyHelper.Register(nameof(WmsStyles), string.Empty, false, - async (layer, oldValue, newValue) => await layer.UpdateImageAsync()); - /// /// The base request URL. /// @@ -58,15 +58,6 @@ namespace MapControl set => SetValue(ServiceUriProperty, value); } - /// - /// Comma-separated sequence of WMS Layer names to be displayed. If not set, the first Layer is displayed. - /// - public string WmsLayers - { - get => (string)GetValue(WmsLayersProperty); - set => SetValue(WmsLayersProperty, value); - } - /// /// Comma-separated sequence of requested WMS Styles. Default is an empty string. /// @@ -76,6 +67,15 @@ namespace MapControl set => SetValue(WmsStylesProperty, value); } + /// + /// Comma-separated sequence of WMS Layer names to be displayed. If not set, the first Layer is displayed. + /// + public string WmsLayers + { + get => (string)GetValue(WmsLayersProperty); + set => SetValue(WmsLayersProperty, value); + } + /// /// Gets a list of all layer names returned by a GetCapabilities response. /// diff --git a/MapControl/Shared/WmtsTileLayer.cs b/MapControl/Shared/WmtsTileLayer.cs index 02883f01..e10637f0 100644 --- a/MapControl/Shared/WmtsTileLayer.cs +++ b/MapControl/Shared/WmtsTileLayer.cs @@ -28,7 +28,7 @@ namespace MapControl public class WmtsTileLayer : MapTileLayerBase { public static readonly DependencyProperty CapabilitiesUriProperty = - DependencyPropertyHelper.Register(nameof(CapabilitiesUri), null, false, + DependencyPropertyHelper.Register(nameof(CapabilitiesUri), null, (layer, oldValue, newValue) => layer.TileMatrixSets.Clear()); public static readonly DependencyProperty LayerProperty = diff --git a/MapControl/WPF/DependencyPropertyHelper.WPF.cs b/MapControl/WPF/DependencyPropertyHelper.WPF.cs index 6cf024ff..fbd67d96 100644 --- a/MapControl/WPF/DependencyPropertyHelper.WPF.cs +++ b/MapControl/WPF/DependencyPropertyHelper.WPF.cs @@ -21,9 +21,9 @@ namespace MapControl public static DependencyProperty Register( string name, TValue defaultValue = default, - bool bindTwoWayByDefault = false, Action changed = null, - Func coerce = null) + Func coerce = null, + bool bindTwoWayByDefault = false) where TOwner : DependencyObject { var metadata = new FrameworkPropertyMetadata diff --git a/MapControl/WPF/MapBase.WPF.cs b/MapControl/WPF/MapBase.WPF.cs index 089223cb..cf4a5422 100644 --- a/MapControl/WPF/MapBase.WPF.cs +++ b/MapControl/WPF/MapBase.WPF.cs @@ -14,44 +14,50 @@ namespace MapControl new QuadraticEase { EasingMode = EasingMode.EaseOut }); public static readonly DependencyProperty CenterProperty = - DependencyPropertyHelper.Register(nameof(Center), new Location(), true, + DependencyPropertyHelper.Register(nameof(Center), new Location(), (map, oldValue, newValue) => map.CenterPropertyChanged(newValue), - (map, value) => map.CoerceCenterProperty(value)); + (map, value) => map.CoerceCenterProperty(value), + true); public static readonly DependencyProperty TargetCenterProperty = - DependencyPropertyHelper.Register(nameof(TargetCenter), new Location(), true, + DependencyPropertyHelper.Register(nameof(TargetCenter), new Location(), (map, oldValue, newValue) => map.TargetCenterPropertyChanged(newValue), - (map, value) => map.CoerceCenterProperty(value)); + (map, value) => map.CoerceCenterProperty(value), + true); public static readonly DependencyProperty MinZoomLevelProperty = - DependencyPropertyHelper.Register(nameof(MinZoomLevel), 1d, false, + DependencyPropertyHelper.Register(nameof(MinZoomLevel), 1d, (map, oldValue, newValue) => map.MinZoomLevelPropertyChanged(newValue), (map, value) => map.CoerceMinZoomLevelProperty(value)); public static readonly DependencyProperty MaxZoomLevelProperty = - DependencyPropertyHelper.Register(nameof(MaxZoomLevel), 20d, false, + DependencyPropertyHelper.Register(nameof(MaxZoomLevel), 20d, (map, oldValue, newValue) => map.MaxZoomLevelPropertyChanged(newValue), (map, value) => map.CoerceMaxZoomLevelProperty(value)); public static readonly DependencyProperty ZoomLevelProperty = - DependencyPropertyHelper.Register(nameof(ZoomLevel), 1d, true, + DependencyPropertyHelper.Register(nameof(ZoomLevel), 1d, (map, oldValue, newValue) => map.ZoomLevelPropertyChanged(newValue), - (map, value) => map.CoerceZoomLevelProperty(value)); + (map, value) => map.CoerceZoomLevelProperty(value), + true); public static readonly DependencyProperty TargetZoomLevelProperty = - DependencyPropertyHelper.Register(nameof(TargetZoomLevel), 1d, true, + DependencyPropertyHelper.Register(nameof(TargetZoomLevel), 1d, (map, oldValue, newValue) => map.TargetZoomLevelPropertyChanged(newValue), - (map, value) => map.CoerceZoomLevelProperty(value)); + (map, value) => map.CoerceZoomLevelProperty(value), + true); public static readonly DependencyProperty HeadingProperty = - DependencyPropertyHelper.Register(nameof(Heading), 0d, true, + DependencyPropertyHelper.Register(nameof(Heading), 0d, (map, oldValue, newValue) => map.HeadingPropertyChanged(newValue), - (map, value) => map.CoerceHeadingProperty(value)); + (map, value) => map.CoerceHeadingProperty(value), + true); public static readonly DependencyProperty TargetHeadingProperty = - DependencyPropertyHelper.Register(nameof(TargetHeading), 0d, true, + DependencyPropertyHelper.Register(nameof(TargetHeading), 0d, (map, oldValue, newValue) => map.TargetHeadingPropertyChanged(newValue), - (map, value) => map.CoerceHeadingProperty(value)); + (map, value) => map.CoerceHeadingProperty(value), + true); private static readonly DependencyPropertyKey ViewScalePropertyKey = DependencyPropertyHelper.RegisterReadOnly(nameof(ViewScale), 0d); diff --git a/MapControl/WPF/MapMultiPolygon.WPF.cs b/MapControl/WPF/MapMultiPolygon.WPF.cs index c8ff4f03..f7ad7ee8 100644 --- a/MapControl/WPF/MapMultiPolygon.WPF.cs +++ b/MapControl/WPF/MapMultiPolygon.WPF.cs @@ -19,11 +19,11 @@ namespace MapControl public class MapMultiPolygon : MapPath { public static readonly DependencyProperty PolygonsProperty = - DependencyPropertyHelper.Register>>(nameof(Polygons), null, false, + DependencyPropertyHelper.Register>>(nameof(Polygons), null, (polygon, oldValue, newValue) => polygon.DataCollectionPropertyChanged(oldValue, newValue)); public static readonly DependencyProperty FillRuleProperty = - DependencyPropertyHelper.Register(nameof(FillRule), FillRule.EvenOdd, false, + DependencyPropertyHelper.Register(nameof(FillRule), FillRule.EvenOdd, (polygon, oldValue, newValue) => ((PathGeometry)polygon.Data).FillRule = newValue); /// diff --git a/MapControl/WinUI/DependencyPropertyHelper.WinUI.cs b/MapControl/WinUI/DependencyPropertyHelper.WinUI.cs index 81a7dea4..bcdf2869 100644 --- a/MapControl/WinUI/DependencyPropertyHelper.WinUI.cs +++ b/MapControl/WinUI/DependencyPropertyHelper.WinUI.cs @@ -18,7 +18,6 @@ namespace MapControl public static DependencyProperty Register( string name, TValue defaultValue = default, - bool bindTwoWayByDefault = false, // unused in WinUI/UWP Action changed = null) where TOwner : DependencyObject { diff --git a/MapControl/WinUI/MapBase.WinUI.cs b/MapControl/WinUI/MapBase.WinUI.cs index 8778867d..4003d7e7 100644 --- a/MapControl/WinUI/MapBase.WinUI.cs +++ b/MapControl/WinUI/MapBase.WinUI.cs @@ -23,43 +23,43 @@ namespace MapControl new QuadraticEase { EasingMode = EasingMode.EaseOut }); public static readonly DependencyProperty CenterProperty = - DependencyPropertyHelper.Register(nameof(Center), new Location(), true, + DependencyPropertyHelper.Register(nameof(Center), new Location(), (map, oldValue, newValue) => map.CenterPropertyChanged(newValue)); public static readonly DependencyProperty TargetCenterProperty = - DependencyPropertyHelper.Register(nameof(TargetCenter), new Location(), true, + DependencyPropertyHelper.Register(nameof(TargetCenter), new Location(), (map, oldValue, newValue) => map.TargetCenterPropertyChanged(newValue)); public static readonly DependencyProperty MinZoomLevelProperty = - DependencyPropertyHelper.Register(nameof(MinZoomLevel), 1d, false, + DependencyPropertyHelper.Register(nameof(MinZoomLevel), 1d, (map, oldValue, newValue) => map.MinZoomLevelPropertyChanged(newValue)); public static readonly DependencyProperty MaxZoomLevelProperty = - DependencyPropertyHelper.Register(nameof(MaxZoomLevel), 20d, false, + DependencyPropertyHelper.Register(nameof(MaxZoomLevel), 20d, (map, oldValue, newValue) => map.MaxZoomLevelPropertyChanged(newValue)); public static readonly DependencyProperty ZoomLevelProperty = - DependencyPropertyHelper.Register(nameof(ZoomLevel), 1d, true, + DependencyPropertyHelper.Register(nameof(ZoomLevel), 1d, (map, oldValue, newValue) => map.ZoomLevelPropertyChanged(newValue)); public static readonly DependencyProperty TargetZoomLevelProperty = - DependencyPropertyHelper.Register(nameof(TargetZoomLevel), 1d, true, + DependencyPropertyHelper.Register(nameof(TargetZoomLevel), 1d, (map, oldValue, newValue) => map.TargetZoomLevelPropertyChanged(newValue)); public static readonly DependencyProperty HeadingProperty = - DependencyPropertyHelper.Register(nameof(Heading), 0d, true, + DependencyPropertyHelper.Register(nameof(Heading), 0d, (map, oldValue, newValue) => map.HeadingPropertyChanged(newValue)); public static readonly DependencyProperty TargetHeadingProperty = - DependencyPropertyHelper.Register(nameof(TargetHeading), 0d, true, + DependencyPropertyHelper.Register(nameof(TargetHeading), 0d, (map, oldValue, newValue) => map.TargetHeadingPropertyChanged(newValue)); public static readonly DependencyProperty ViewScaleProperty = DependencyPropertyHelper.Register(nameof(ViewScale), 0d); private static readonly DependencyProperty AnimatedCenterProperty = - DependencyPropertyHelper.Register(nameof(AnimatedCenter), - new Windows.Foundation.Point(), false, (map, oldValue, newValue) => map.Center = new Location(newValue.Y, newValue.X)); + DependencyPropertyHelper.Register(nameof(AnimatedCenter), new Windows.Foundation.Point(), + (map, oldValue, newValue) => map.Center = new Location(newValue.Y, newValue.X)); private Windows.Foundation.Point AnimatedCenter => (Windows.Foundation.Point)GetValue(AnimatedCenterProperty); diff --git a/MapControl/WinUI/MapContentControl.WinUI.cs b/MapControl/WinUI/MapContentControl.WinUI.cs index f491d325..1e657a92 100644 --- a/MapControl/WinUI/MapContentControl.WinUI.cs +++ b/MapControl/WinUI/MapContentControl.WinUI.cs @@ -18,11 +18,11 @@ namespace MapControl public class MapContentControl : ContentControl { public static readonly DependencyProperty AutoCollapseProperty = - DependencyPropertyHelper.Register(nameof(AutoCollapse), false, false, + DependencyPropertyHelper.Register(nameof(AutoCollapse), false, (control, oldValue, newValue) => MapPanel.SetAutoCollapse(control, newValue)); public static readonly DependencyProperty LocationProperty = - DependencyPropertyHelper.Register(nameof(Location), null, false, + DependencyPropertyHelper.Register(nameof(Location), null, (control, oldValue, newValue) => MapPanel.SetLocation(control, newValue)); public MapContentControl() diff --git a/MapControl/WinUI/MapItem.WinUI.cs b/MapControl/WinUI/MapItem.WinUI.cs index b0304953..055e05f3 100644 --- a/MapControl/WinUI/MapItem.WinUI.cs +++ b/MapControl/WinUI/MapItem.WinUI.cs @@ -18,11 +18,11 @@ namespace MapControl public partial class MapItem { public static readonly DependencyProperty AutoCollapseProperty = - DependencyPropertyHelper.Register(nameof(AutoCollapse), false, false, + DependencyPropertyHelper.Register(nameof(AutoCollapse), false, (item, oldValue, newValue) => MapPanel.SetAutoCollapse(item, newValue)); public static readonly DependencyProperty LocationProperty = - DependencyPropertyHelper.Register(nameof(Location), null, false, + DependencyPropertyHelper.Register(nameof(Location), null, (item, oldValue, newValue) => item.LocationPropertyChanged(newValue)); private void LocationPropertyChanged(Location location) diff --git a/MapControl/WinUI/PushpinBorder.WinUI.cs b/MapControl/WinUI/PushpinBorder.WinUI.cs index c49fed59..a1fd5afc 100644 --- a/MapControl/WinUI/PushpinBorder.WinUI.cs +++ b/MapControl/WinUI/PushpinBorder.WinUI.cs @@ -25,11 +25,11 @@ namespace MapControl public partial class PushpinBorder : UserControl { public static readonly DependencyProperty ArrowSizeProperty = - DependencyPropertyHelper.Register(nameof(ArrowSize), new Size(10d, 20d), false, + DependencyPropertyHelper.Register(nameof(ArrowSize), new Size(10d, 20d), (border, oldValue, newValue) => border.SetBorderMargin()); public static readonly DependencyProperty BorderWidthProperty = - DependencyPropertyHelper.Register(nameof(BorderWidth), 0d, false, + DependencyPropertyHelper.Register(nameof(BorderWidth), 0d, (border, oldValue, newValue) => border.SetBorderMargin()); private readonly Border border = new Border();