mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2026-04-04 14:08:32 +00:00
warnings
This commit is contained in:
parent
5bc9c73fad
commit
4113104eff
3 changed files with 4 additions and 12 deletions
|
|
@ -2,9 +2,10 @@
|
|||
using Avalonia.Controls;
|
||||
using System;
|
||||
|
||||
#pragma warning disable AVP1001 // The same AvaloniaProperty should not be registered twice
|
||||
|
||||
namespace MapControl
|
||||
{
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("AvaloniaProperty", "AVP1001")]
|
||||
public static class DependencyPropertyHelper
|
||||
{
|
||||
public static StyledProperty<TValue> Register<TOwner, TValue>(
|
||||
|
|
@ -43,13 +44,5 @@ namespace MapControl
|
|||
|
||||
return property;
|
||||
}
|
||||
|
||||
public static DirectProperty<TOwner, TValue> RegisterReadOnly<TOwner, TValue>(
|
||||
string name,
|
||||
Func<TOwner, TValue> getter)
|
||||
where TOwner : AvaloniaObject
|
||||
{
|
||||
return AvaloniaProperty.RegisterDirect(name, getter);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ namespace MapControl
|
|||
(map, value) => map.CoerceHeadingProperty(value));
|
||||
|
||||
public static readonly DirectProperty<MapBase, double> ViewScaleProperty =
|
||||
DependencyPropertyHelper.RegisterReadOnly<MapBase, double>(nameof(ViewScale), map => map.ViewScale);
|
||||
AvaloniaProperty.RegisterDirect<MapBase, double>(nameof(ViewScale), map => map.ViewScale);
|
||||
|
||||
private CancellationTokenSource centerCts;
|
||||
private CancellationTokenSource zoomLevelCts;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue