asusralis
Topic Author
Posts: 152
Joined: 30 Jul 2018, 05:03

How to start a Storyboard from a DataEventTrigger?

08 Jul 2022, 12:49

I want to start a storyboard when an event from a viewmodel is invoked. What is the best way of doing this?
 
User avatar
sfernandez
Site Admin
Posts: 3363
Joined: 22 Dec 2011, 19:20

Re: How to start a Storyboard from a DataEventTrigger?

11 Jul 2022, 17:01

Hi, you have to use the ControlStoryboardAction to begin the storyboard:
<Grid
   xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
   xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
   xmlns:b="http://schemas.microsoft.com/xaml/behaviors"
   xmlns:noesis="clr-namespace:NoesisGUIExtensions;assembly=Noesis.GUI.Extensions">
  <Grid.Resources>
    <Storyboard x:Key="anim" .../>
  </Grid.Resources>
  <b:Interaction.Triggers>
    <noesis:DataEventTrigger Source="{Binding}" EventName="DownloadFinished">
      <b:ControlStoryboardAction Storyboard="{StaticResource anim}"/>
    </noesis:DataEventTrigger>
  </b:Interaction.Triggers>
</Grid>

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 1 guest