I really want to give the answer "use jQuery", but since this is WPF, I suppose something better is needed. To get started, I would determine where it will be in your xaml file. I would do it something like this:
<Window ...> <Grid> <Grid x:Name="DropDownBar" HorizontalAlignment="Stretch" Height="0"> <Rectangle Fill="Orange" /> </Grid> </Grid> </Window>
To get that nice animation effect, something like:
<Window.Resources> <Storyboard x:Key="LoadAnimation" Duration="0:0:3"> <DoubleAnimation Storyboard.TargetName="DropDownBar" Storyboard.TargetProperty="Height" From="0" To="30" /> </Storyboard> </Window.Resources>
And then you just need to call it when the page loads:
<Window.Triggers> <EventTrigger RoutedEvent="Window.Loaded"> <BeginStoryboard Storyboard="{StaticResource LoadAnimation}" /> </EventTrigger> </Window.Triggers>
I typed this in this field, so there are several typos here and there. But basically, how I did it. Another alternative is fixing the height and moving the field from -high to 0.
source share