Getting a control in WPF or Silverlight to fade in on a specific event is a doddle.
Here’s an example of a menu control I created that fades in when the StackPanel has loaded.
The StackPanel contains multiple menu item controls, each of which comprises of an image and some text.
The key points here are:
- EventTrigger RoutedEvent which tells the animation to start on the StackPanel.Loaded event
- Use a double animation, double being the opacity value data type
<StackPanel x:Name="MenuContainer" Orientation="Horizontal" HorizontalAlignment="Center">