- plantumleditor-src-v1.zip
- GoogleCode
- Article
- PlantUMLEditor.htm
- plantumleditor
- contextmenu.png
- DesignTimeView.png
- dotnetInstaller.png
- dotnetInstaller_embed.png
- jsmooth.png
- sample_diagram.png
- Screenshot.png
- SolutionTree.png
- PlantUmlEditor.Setup
- Banner.bmp
- dotnetInstaller
- PlantUmlSetup.vdproj
- PlantUmlEditor.sln
- PlantUmlEditor.suo
- PlantUmlEditor
- Test.Utilities
- TestLibraries
- moq
- xunit
- SpecificationExample.dll
- SpecificationExample.pdb
- xunit.dll
- xunit.dll.tdnet
- xunit.runner.tdnet.dll
- xunit.runner.utility.dll
- Utilities
|
// Source: http://www.codeproject.com/KB/WPF/GridLengthAnimation.aspx
using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Media.Animation;
using System.Windows;
using System.Diagnostics;
namespace PlantUmlEditor.CustomAnimation
{
internal class GridLengthAnimation : AnimationTimeline
{
static GridLengthAnimation()
{
FromProperty = DependencyProperty.Register("From", typeof(GridLength),
typeof(GridLengthAnimation));
ToProperty = DependencyProperty.Register("To", typeof(GridLength),
typeof(GridLengthAnimation));
}
public override Type TargetPropertyType
{
get
{
return typeof(GridLength);
}
}
protected override System.Windows.Freezable CreateInstanceCore()
{
return new GridLengthAnimation();
}
public static readonly DependencyProperty FromProperty;
public GridLength From
{
get
{
return (GridLength)GetValue(GridLengthAnimation.FromProperty);
}
set
{
SetValue(GridLengthAnimation.FromProperty, value);
}
}
public static readonly DependencyProperty ToProperty;
public GridLength To
{
get
{
return (GridLength)GetValue(GridLengthAnimation.ToProperty);
}
set
{
SetValue(GridLengthAnimation.ToProperty, value);
}
}
public override object GetCurrentValue(object defaultOriginValue,
object defaultDestinationValue, AnimationClock animationClock)
{
double fromVal = ((GridLength)GetValue(GridLengthAnimation.FromProperty)).Value;
double toVal = ((GridLength)GetValue(GridLengthAnimation.ToProperty)).Value;
if (fromVal > toVal)
{
return new GridLength((1 - animationClock.CurrentProgress.Value) * (fromVal - toVal) + toVal, GridUnitType.Pixel);
}
else
return new GridLength(animationClock.CurrentProgress.Value * (toVal - fromVal) + fromVal, GridUnitType.Pixel);
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.