I have a 2nd stackpanel that appears like a drawer, shown below
______ ______ _____
| | | | |
| main | -> | main | 2nd |
|______| |______|_____|
-->
I have both expand and collapse animations for the drawer. They are bound to a boolean that I update in code.
Everything works fine, except when I initially start my application, the collapse animation gets fired because the initial value is false. Is there a way to bind something without it triggering upon binding?
Here is what is looks like in my xaml, where I am using a DataTrigger bound to the boolen thats in my code:
<StackPanel x:Name="expandMe" Width="0" Orientation="Vertical" >
<StackPanel.Style>
<Style>
<Style.Triggers>
<DataTrigger Binding="{Binding ExpandBoolean}" Value="False">
.......
I don’t see the Setter in your style to make sure that the StackPanel loads collapsed. I think that will do it.