mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2025-12-06 07:12:04 +01:00
Update MapBase.Avalonia.cs
This commit is contained in:
parent
4113104eff
commit
3c493de373
|
|
@ -4,6 +4,7 @@
|
|||
|
||||
global using Avalonia;
|
||||
using Avalonia.Animation;
|
||||
using Avalonia.Animation.Easings;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Styling;
|
||||
using System.Threading;
|
||||
|
|
@ -13,6 +14,9 @@ namespace MapControl
|
|||
{
|
||||
public partial class MapBase
|
||||
{
|
||||
public static readonly StyledProperty<Easing> AnimationEasingProperty =
|
||||
DependencyPropertyHelper.Register<MapBase, Easing>(nameof(AnimationEasing), new QuadraticEaseOut());
|
||||
|
||||
public static readonly StyledProperty<Location> CenterProperty =
|
||||
DependencyPropertyHelper.Register<MapBase, Location>(nameof(Center), new Location(), true,
|
||||
(map, oldValue, newValue) => map.CenterPropertyChanged(newValue),
|
||||
|
|
@ -85,6 +89,16 @@ namespace MapControl
|
|||
UpdateTransform();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Easing of the Center, ZoomLevel and Heading animations.
|
||||
/// The default value is a QuadraticEaseOut.
|
||||
/// </summary>
|
||||
public Easing AnimationEasing
|
||||
{
|
||||
get => GetValue(AnimationEasingProperty);
|
||||
set => SetValue(AnimationEasingProperty, value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the scaling factor from projected map coordinates to view coordinates,
|
||||
/// as pixels per meter.
|
||||
|
|
@ -134,6 +148,7 @@ namespace MapControl
|
|||
{
|
||||
FillMode = FillMode.Forward,
|
||||
Duration = AnimationDuration,
|
||||
Easing = AnimationEasing,
|
||||
Children =
|
||||
{
|
||||
new KeyFrame
|
||||
|
|
@ -193,6 +208,7 @@ namespace MapControl
|
|||
{
|
||||
FillMode = FillMode.Forward,
|
||||
Duration = AnimationDuration,
|
||||
Easing = AnimationEasing,
|
||||
Children =
|
||||
{
|
||||
new KeyFrame
|
||||
|
|
@ -254,6 +270,7 @@ namespace MapControl
|
|||
{
|
||||
FillMode = FillMode.Forward,
|
||||
Duration = AnimationDuration,
|
||||
Easing = AnimationEasing,
|
||||
Children =
|
||||
{
|
||||
new KeyFrame
|
||||
|
|
|
|||
Loading…
Reference in a new issue