Reputation: 283
I want to create some animation while navigating from one UserControl to another UserControl. It can be any simple animation like we have effects in MS PowerPoint.
How can I start?
Edit:
Lets take following xaml
<StackPanel>
<Label>
<Hyperlink Click="ConfigureAccounts_Click">
<TextBlock>Configure Accounts</TextBlock>
</Hyperlink>
</Label>
<Label>
<Hyperlink Click="ConfigurePassangersList_Click">
<TextBlock>Accounts</TextBlock>
</Hyperlink>
</Label>
</StackPanel>
Here On click of HyperLinks I am doing -
private void ConfigureAccounts_Click(object sender, RoutedEventArgs e)
{
ContentGrid.Children.Clear();
//Here is the animation
ContentGrid.Children.Add(new ConfigureAccounts());
}
private void ConfigurePassangersList_Click(object sender, RoutedEventArgs e)
{
ContentGrid.Children.Clear();
//Here is the animation
ContentGrid.Children.Add(new ConfigurePassangersList());
}
The two constructors which I am calling are simply UserControls.
Upvotes: 0
Views: 111
Reputation: 44068
The WPF Bag of Tricks has a TransitionPresenter
class, which is basically a ContentPresenter
that supports animated transitions:
Basic usage:
<bot:TransitionPresenter Content="{Binding SomeViewModelForWhichYouHaveADataTemplateDefined}">
<bot:TransitionPresenter.Transition>
<bot:FadeTransition Duration="00:00:00.3"/>
</bot:TransitionPresenter.Transition>
</bot:TransitionPresenter>
Upvotes: 2
Reputation: 487
you can make use of mouse hover options ..change the colours.it would be a simple one to give a start.
And i dont call this as animation.if you really need animation for this.you need to start up with flash scripting animation.this is the better one for navigation animation.
Hope this helps. :)
Upvotes: 0