Click or drag to resize

RectAnimation Class

Animates the value of a System.Windows.Rect property between two target values using linear interpolation over a specified Duration.
Inheritance Hierarchy

Namespace:  Ab2d.Controls
Assembly:  Ab2d.Controls.ZoomPanel (in Ab2d.Controls.ZoomPanel.dll) Version: 5.2.6631.1040
Syntax
C#
public class RectAnimation : AnimationTimeline

The RectAnimation type exposes the following members.

Constructors
  NameDescription
Public methodRectAnimation
Initializes a new instance of the RectAnimation class.
Public methodRectAnimation(Rect, Duration)
Initializes a new instance of the RectAnimation class.
Public methodRectAnimation(Rect, Duration, FillBehavior)
Initializes a new instance of the RectAnimation class.
Public methodRectAnimation(Rect, Rect, Duration)
Initializes a new instance of the RectAnimation class.
Public methodRectAnimation(Rect, Rect, Duration, FillBehavior)
Initializes a new instance of the RectAnimation class.
Top
Properties
  NameDescription
Public propertyFrom
Gets or sets the animation's starting value. This is a dependency property.
Public propertyTargetPropertyType
TargetPropertyType
(Overrides AnimationTimelineTargetPropertyType.)
Public propertyTo
Gets or sets the animation's ending value. This is a dependency property.
Top
Methods
  NameDescription
Public methodClone
Creates a modifiable clone of this RectAnimation, making deep copies of this object's values. When copying dependency properties, this method copies resource references and data bindings (but they might no longer resolve) but not animations or their current values.
Public methodGetCurrentValue
Calculates a value that represents the current value of the property being animated, as determined by the RectAnimation.
(Overrides AnimationTimelineGetCurrentValue(Object, Object, AnimationClock).)
Top
Fields
  NameDescription
Public fieldStatic memberFromProperty
FromProperty
Public fieldStatic memberToProperty
ToProperty
Top
Examples
The following example defines a Button that starts a RectAnimation of a VieboxEx's Viewbox.
<Window x:Class="Ab2d.ZoomControlSample.ZoomPanelSample"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:ab2d="clr-namespace:Ab2d.Controls;assembly=Ab2d.Controls.ZoomPanel">
  <Grid>
     <Button Name="StartStoryboardButton" VerticalAlignment="Top" HorizontalAlignment="Left">Start Animation
          <Button.Triggers>
              <EventTrigger RoutedEvent="Button.Click">
                  <EventTrigger.Actions>
                      <BeginStoryboard>
                          <Storyboard Name="XamlRectStoryboard">
                              <ab2d:RectAnimation From="0 0 1 1" To="0.2 0.2 0.6 0.6" Duration="0:0:4"
                                      Storyboard.TargetName="Viewbox1" Storyboard.TargetProperty="Viewbox"/>
                              <ab2d:RectAnimation To="0.5 0.4 0.2 0.2" BeginTime="0:0:4" Duration="0:0:4"
                                      Storyboard.TargetName="Viewbox1" Storyboard.TargetProperty="Viewbox"/>
                              <ab2d:RectAnimation To="0 0 1 1" BeginTime="0:0:8" Duration="0:0:2"
                                      Storyboard.TargetName="Viewbox1" Storyboard.TargetProperty="Viewbox"/>
                          </Storyboard>
                      </BeginStoryboard>
                  </EventTrigger.Actions>
              </EventTrigger>
          </Button.Triggers>
      </Button>  
      <ab2d:ViewboxEx Name="Viewbox1">
        <TextBlock>12345</TextBlock>
      </ab2d:ViewboxEx>
    </Grid>
</Window>
See Also