mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2026-04-07 23:45:05 +00:00
Reworked animations
This commit is contained in:
parent
12b33c5376
commit
8708c7ffe6
9 changed files with 159 additions and 85 deletions
|
|
@ -175,7 +175,7 @@ namespace MapControl
|
|||
|
||||
centerAnimation.Completed += CenterAnimationCompleted;
|
||||
|
||||
this.BeginAnimation(nameof(AnimatedCenter), centerAnimation);
|
||||
BeginAnimation(nameof(AnimatedCenter), centerAnimation);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -270,7 +270,7 @@ namespace MapControl
|
|||
|
||||
zoomLevelAnimation.Completed += ZoomLevelAnimationCompleted;
|
||||
|
||||
this.BeginAnimation(nameof(ZoomLevel), zoomLevelAnimation);
|
||||
BeginAnimation(nameof(ZoomLevel), zoomLevelAnimation);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -346,7 +346,7 @@ namespace MapControl
|
|||
|
||||
headingAnimation.Completed += HeadingAnimationCompleted;
|
||||
|
||||
this.BeginAnimation(nameof(Heading), headingAnimation);
|
||||
BeginAnimation(nameof(Heading), headingAnimation);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -362,5 +362,15 @@ namespace MapControl
|
|||
headingAnimation = null;
|
||||
}
|
||||
}
|
||||
|
||||
public void BeginAnimation(string property, Timeline animation)
|
||||
{
|
||||
Storyboard.SetTarget(animation, this);
|
||||
Storyboard.SetTargetProperty(animation, property);
|
||||
|
||||
var storyboard = new Storyboard();
|
||||
storyboard.Children.Add(animation);
|
||||
storyboard.Begin();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue