I have a Grid element that has two columns and three rows. The last line has a height of 0 ... and I'm animating the height property with a custom animation class, because the gridheight property is not an integer.
The animation works just fine, but when I activate it, it changes the width of the second column, it would seem, at random .. sometimes itโs just a few pixels more, and sometimes twice as many ...
Here is the grid code
<Grid > <Grid.ColumnDefinitions> <ColumnDefinition /> <ColumnDefinition Width="50"/> </Grid.ColumnDefinitions> <Grid.RowDefinitions> <RowDefinition Height="1*" /> <RowDefinition Height="7"/> <RowDefinition Name="LyricsRow" Height="1"> <RowDefinition.Style> <Style> <Style.Triggers> <DataTrigger Binding="{Binding Path=IsTrayOpen}" Value="True"> <DataTrigger.EnterActions> <BeginStoryboard> <Storyboard> <local:GridLengthAnimation Storyboard.TargetProperty="Height" From="0" To="150" Duration="0:0:0.3" > </local:GridLengthAnimation> </Storyboard> </BeginStoryboard> </DataTrigger.EnterActions> <DataTrigger.ExitActions> <BeginStoryboard> <Storyboard> <local:GridLengthAnimation Storyboard.TargetProperty="Height" From="150" To="0" Duration="0:0:0.5" /> </Storyboard> </BeginStoryboard> </DataTrigger.ExitActions> </DataTrigger> </Style.Triggers> </Style> </RowDefinition.Style> </RowDefinition> </Grid.RowDefinitions>
Are there any reasons this could happen?
source share