<UserControl x:Class="Wex.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:wex="clr-namespace:Wex.Lib.Interactions;assembly=Wex.Lib" d:DesignHeight="300" d:DesignWidth="400"> <Canvas> <i:Interaction.Triggers> <wex:ReactiveTrigger ImportName="KeyTrigger"> <wex:StoryBoardAction StoryBoardKey="storyBoard1" Action="Begin"/> </wex:ReactiveTrigger> </i:Interaction.Triggers> <Canvas.Resources> <Storyboard Name="myStoryboard" x:Key="storyBoard1" > <!-- 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> <TextBox Text="Type something here, the storyboard will restart with each keystroke"/> <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.
This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)