|
<UserControl x:Class="Slex.Lib.Demo.Views.Demos.ReactiveTrigger"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
xmlns:slex="clr-namespace:Slex.Lib.Interactions;assembly=Slex.Lib"
d:DesignHeight="300" d:DesignWidth="400">
<Canvas>
<i:Interaction.Triggers>
<slex:ReactiveTrigger ImportName="KeyTrigger">
<slex:StoryBoardAction StoryBoardName="myStoryboard" Action="Begin"/>
</slex:ReactiveTrigger>
</i:Interaction.Triggers>
<TextBox Text="Type something here, the storyboard will restart with each keystroke"/>
<Canvas.Resources>
<Storyboard x:Name="myStoryboard">
<!-- Animate the center point of the ellipse. -->
<PointAnimation Storyboard.TargetProperty="Center"
Storyboard.TargetName="MyAnimatedEllipseGeometry"
Duration="0:0:5"
From="20,200"
To="400,100"
RepeatBehavior="Forever" />
</Storyboard>
</Canvas.Resources>
<Path Fill="Blue">
<Path.Data>
<!-- Describe an ellipse. -->
<EllipseGeometry x:Name="MyAnimatedEllipseGeometry"
Center="20,20" RadiusX="15" RadiusY="15" />
</Path.Data>
</Path>
</Canvas>
</UserControl>
|
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.
Architect, Developer, Speaker | Wannabe GUT inventor & Data Scientist | Microsoft MVP in C#