diff --git a/MapControl/Avalonia/MapBase.Avalonia.cs b/MapControl/Avalonia/MapBase.Avalonia.cs index 0c9feebd..dfb32a09 100644 --- a/MapControl/Avalonia/MapBase.Avalonia.cs +++ b/MapControl/Avalonia/MapBase.Avalonia.cs @@ -20,7 +20,6 @@ global using Brush = Avalonia.Media.IBrush; global using ImageSource = Avalonia.Media.IImage; global using DependencyObject = Avalonia.AvaloniaObject; global using DependencyProperty = Avalonia.AvaloniaProperty; -global using UIElement = Avalonia.Controls.Control; global using FrameworkElement = Avalonia.Controls.Control; global using HorizontalAlignment = Avalonia.Layout.HorizontalAlignment; global using VerticalAlignment = Avalonia.Layout.VerticalAlignment; @@ -35,8 +34,8 @@ namespace MapControl { public partial class MapBase { - public static readonly StyledProperty ForegroundProperty = - DependencyPropertyHelper.AddOwner(TextElement.ForegroundProperty); + public static readonly StyledProperty ForegroundProperty = + DependencyPropertyHelper.AddOwner(TextElement.ForegroundProperty); public static readonly StyledProperty AnimationEasingProperty = DependencyPropertyHelper.Register(nameof(AnimationEasing), new QuadraticEaseOut()); diff --git a/MapControl/Avalonia/MapGraticule.Avalonia.cs b/MapControl/Avalonia/MapGraticule.Avalonia.cs index 2ba3962a..3f4fb166 100644 --- a/MapControl/Avalonia/MapGraticule.Avalonia.cs +++ b/MapControl/Avalonia/MapGraticule.Avalonia.cs @@ -10,8 +10,8 @@ namespace MapControl { public partial class MapGraticule : Control, IMapElement { - public static readonly StyledProperty ForegroundProperty = - DependencyPropertyHelper.AddOwner(TextElement.ForegroundProperty, null, + public static readonly StyledProperty ForegroundProperty = + DependencyPropertyHelper.AddOwner(TextElement.ForegroundProperty, null, (graticule, oldValue, newValue) => graticule.InvalidateVisual()); public static readonly StyledProperty FontFamilyProperty = @@ -23,7 +23,7 @@ namespace MapControl public static readonly StyledProperty StrokeThicknessProperty = DependencyPropertyHelper.AddOwner(Shape.StrokeThicknessProperty, 0.5); - public IBrush Foreground + public Brush Foreground { get => GetValue(ForegroundProperty); set => SetValue(ForegroundProperty, value); diff --git a/MapControl/Avalonia/PushpinBorder.Avalonia.cs b/MapControl/Avalonia/PushpinBorder.Avalonia.cs index 991a67b5..37e27c36 100644 --- a/MapControl/Avalonia/PushpinBorder.Avalonia.cs +++ b/MapControl/Avalonia/PushpinBorder.Avalonia.cs @@ -17,11 +17,11 @@ namespace MapControl public static readonly StyledProperty BorderWidthProperty = DependencyPropertyHelper.Register(nameof(BorderWidth)); - public static readonly StyledProperty BackgroundProperty = - DependencyPropertyHelper.Register(nameof(Background)); + public static readonly StyledProperty BackgroundProperty = + DependencyPropertyHelper.Register(nameof(Background)); - public static readonly StyledProperty BorderBrushProperty = - DependencyPropertyHelper.Register(nameof(BorderBrush)); + public static readonly StyledProperty BorderBrushProperty = + DependencyPropertyHelper.Register(nameof(BorderBrush)); static PushpinBorder() { @@ -37,13 +37,13 @@ namespace MapControl set => SetValue(CornerRadiusProperty, value); } - public IBrush Background + public Brush Background { get => GetValue(BackgroundProperty); set => SetValue(BackgroundProperty, value); } - public IBrush BorderBrush + public Brush BorderBrush { get => GetValue(BorderBrushProperty); set => SetValue(BorderBrushProperty, value); diff --git a/MapControl/Shared/MapBase.cs b/MapControl/Shared/MapBase.cs index bbfb2969..62707cca 100644 --- a/MapControl/Shared/MapBase.cs +++ b/MapControl/Shared/MapBase.cs @@ -37,7 +37,7 @@ namespace MapControl DependencyPropertyHelper.Register(nameof(AnimationDuration), TimeSpan.FromSeconds(0.3)); public static readonly DependencyProperty MapLayerProperty = - DependencyPropertyHelper.Register(nameof(MapLayer), null, + DependencyPropertyHelper.Register(nameof(MapLayer), null, (map, oldValue, newValue) => map.MapLayerPropertyChanged(oldValue, newValue)); public static readonly DependencyProperty MapProjectionProperty = @@ -83,9 +83,9 @@ namespace MapControl /// If the layer implements IMapLayer (like MapTileLayer or MapImageLayer), its (non-null) MapBackground /// and MapForeground property values are used for the MapBase Background and Foreground properties. /// - public UIElement MapLayer + public FrameworkElement MapLayer { - get => (UIElement)GetValue(MapLayerProperty); + get => (FrameworkElement)GetValue(MapLayerProperty); set => SetValue(MapLayerProperty, value); } @@ -431,7 +431,7 @@ namespace MapControl internalPropertyChange = false; } - private void MapLayerPropertyChanged(UIElement oldLayer, UIElement newLayer) + private void MapLayerPropertyChanged(FrameworkElement oldLayer, FrameworkElement newLayer) { if (oldLayer != null) {