mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2026-04-06 15:05:50 +00:00
MapImageLayer animation
This commit is contained in:
parent
2d6b2eb2aa
commit
e0e2061014
5 changed files with 22 additions and 24 deletions
|
|
@ -3,14 +3,14 @@
|
|||
// Licensed under the Microsoft Public License (Ms-PL)
|
||||
|
||||
using System;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows;
|
||||
using System.Windows.Media.Animation;
|
||||
|
||||
namespace MapControl
|
||||
{
|
||||
public partial class MapImageLayer
|
||||
{
|
||||
public static void FadeOver(Image topImage, Image bottomImage)
|
||||
private void FadeOver()
|
||||
{
|
||||
var fadeInAnimation = new DoubleAnimation
|
||||
{
|
||||
|
|
@ -25,8 +25,16 @@ namespace MapControl
|
|||
Duration = TimeSpan.Zero
|
||||
};
|
||||
|
||||
topImage.BeginAnimation(OpacityProperty, fadeInAnimation);
|
||||
bottomImage.BeginAnimation(OpacityProperty, fadeOutAnimation);
|
||||
Storyboard.SetTarget(fadeInAnimation, Children[1]);
|
||||
Storyboard.SetTargetProperty(fadeInAnimation, new PropertyPath(OpacityProperty));
|
||||
|
||||
Storyboard.SetTarget(fadeOutAnimation, Children[0]);
|
||||
Storyboard.SetTargetProperty(fadeOutAnimation, new PropertyPath(OpacityProperty));
|
||||
|
||||
var storyboard = new Storyboard();
|
||||
storyboard.Children.Add(fadeInAnimation);
|
||||
storyboard.Children.Add(fadeOutAnimation);
|
||||
storyboard.Begin();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue