Reputation: 5858
so I'm putting 2 same-sized StackPanels in the same position. The Visibility of the first StackPanel is Visible, while the second is Collapsed. Then I add this code to my button:
private async void Button_Clicked(object sender, RoutedEventArgs e)
{
StackPanel1.Visibility = Visibility.Collapsed;
StackPanel2.Visibility = Visibility.Visible;
}
this simply makes the first StackPanel gone and the second to be visible.
However, I would like to add a simple animation that will make the first StackPanel fade off to the left to disappear and the second StackPanel comes to alive from the right. Is this possible?
Upvotes: 1
Views: 1732
Reputation: 334
You can see this MSDN post about animations. the animation you're looking for is the fade in/out animation. You'll find the code of the fade in animation here
Upvotes: 1