<MultiDataTrigger>
<MultiDataTrigger.Conditions>
<Condition Binding="{Binding ElementName=Switcher, Path=On}" Value="True"></Condition>
<Condition Binding="{Binding ElementName=Switcher, Path=IsMouseOver}" Value="True"></Condition>
</MultiDataTrigger.Conditions>
<!-- Fire when IsMouseOver is set to true and On is set to true -->
<MultiDataTrigger.EnterActions>
<BeginStoryboard>
<Storyboard>
<DoubleAnimation Storyboard.TargetName="Slider" Storyboard.TargetProperty="Width" To="35" Duration="0:0:0.3"/>
<ThicknessAnimation Storyboard.TargetName="Slider" Storyboard.TargetProperty="Margin" To="30 5 5 5" Duration="0:0:0.3"/>
</Storyboard>
</BeginStoryboard>
</MultiDataTrigger.EnterActions>
<!-- Fire when IsMouseOver is set to false and On is set to true -->
<MultiDataTrigger.ExitActions>
<BeginStoryboard>
<Storyboard>
<DoubleAnimation Storyboard.TargetName="Slider" Storyboard.TargetProperty="Width" To="30" Duration="0:0:0.3"/>
<ThicknessAnimation Storyboard.TargetName="Slider" Storyboard.TargetProperty="Margin" To="35 5 5 5" Duration="0:0:0.3"/>
</Storyboard>
</BeginStoryboard>
</MultiDataTrigger.ExitActions>
</MultiDataTrigger>
<MultiDataTrigger>
<MultiDataTrigger.Conditions>
<Condition Binding="{Binding ElementName=Switcher, Path=On}" Value="False"></Condition>
<Condition Binding="{Binding ElementName=Switcher, Path=IsMouseOver}" Value="True"></Condition>
</MultiDataTrigger.Conditions>
<!-- Fire when IsMouseOver is set to true and On is set to false -->
<MultiDataTrigger.EnterActions>
<BeginStoryboard>
<Storyboard>
<DoubleAnimation Storyboard.TargetName="Slider" Storyboard.TargetProperty="Width" To="35" Duration="0:0:0.3"/>
</Storyboard>
</BeginStoryboard>
</MultiDataTrigger.EnterActions>
<!-- Fire when IsMouseOver is set to false and On is set to false -->
<MultiDataTrigger.ExitActions>
<BeginStoryboard>
<Storyboard>
<DoubleAnimation Storyboard.TargetName="Slider" Storyboard.TargetProperty="Width" To="30" Duration="0:0:0.3"/>
</Storyboard>
</BeginStoryboard>
</MultiDataTrigger.ExitActions>
</MultiDataTrigger>
我有以下多数据触发器。还检查了依赖项属性,这就是为什么我不在此处发布它的原因。我对每个数据触发器的输入和退出操作均应做的评论。第二个工作正常。但是我不能让第一个工作!数据触发器是否有任何可行的方式,但是我的情节提要被覆盖