MultiDataTrigger with Dependency Properties problem

62 Views Asked by At
<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>

I have the following multi data triggers. The dependency property is also checked that's why I am not posting it here. I have comment to every data triggers enter and exit actions to what they are supposed to do. The second one is working just fine. However I can't get the first one working! Is there any possible way that the data trigger is working but my storyboard gets overridden

0

There are 0 best solutions below