Odpovědět DataTrigger.EnterActions

  • 22. prosince 2005 8:51
     
     

    I'm having problems getting DataTriggers.EnterActions to work.  Given the following snipet:

    <DataTemplate.Triggers>

    <Trigger Property="IsMouseOver" Value="True">

    <Trigger.EnterActions>

    <BeginStoryboard>

    <Storyboard>

    <DoubleAnimation Storyboard.TargetName="itemBackground" Storyboard.TargetProperty="Opacity" To="1" Duration="0:0:0.2" />

    </Storyboard>

    </BeginStoryboard>

    </Trigger.EnterActions>

    <Trigger.ExitActions>

    <BeginStoryboard>

    <Storyboard>

    <DoubleAnimation Storyboard.TargetName="itemBackground" Storyboard.TargetProperty="Opacity"

    To="0" Duration="0:0:0.2" />

    </Storyboard>

    </BeginStoryboard>

    </Trigger.ExitActions>

    </Trigger>

    <DataTrigger Binding="{Binding ShowAlert}" Value="True">

    <DataTrigger.EnterActions>

    <BeginStoryboard>

    <Storyboard >

    <DoubleAnimation Storyboard.TargetName="itemBackground" Storyboard.TargetProperty="Opacity" To="1" Duration="0:0:5" />

    </Storyboard>

    </BeginStoryboard>

    </DataTrigger.EnterActions>

    <DataTrigger.ExitActions>

    <BeginStoryboard>

    <Storyboard>

    <DoubleAnimation Storyboard.TargetName="itemBackground" Storyboard.TargetProperty="Opacity" To="0" Duration="0:0:1" />

    </Storyboard>

    </BeginStoryboard>

    </DataTrigger.ExitActions>

    </DataTrigger>

    </DataTemplate.Triggers>

    </DataTemplate>

    The Trigger.EnterActions fires and works fine.  However the DataTrigger.EnterActions, which performs the same animation does not fire.  I placed a breakpoint on the property that the DataTrigger.EnterActions is bound to, and the property is being accessed.  Anyone have experience with DataTrigger.EnterActions?  Thanks. 

Všechny reakce

  • 10. ledna 2006 23:10
     
     
    On what object does ShowAlert exist? Does the object support INotifyPropertyChanged?
  • 25. ledna 2006 19:17
     
     Odpovědět
    Does the data item you are triggering against implement INotifyPropertyChanged?