Vjendra Gaorh
Vjendra Gaorh

Reputation: 328

how to apply Transition animation between two Datatemplates while swapping within same WPF Listbox?

I have a scenario where i have two different DataTemplates for a Listbox which i apply dynamically as needed while changing the ItemsSource of Listbox. The two DataTemplates containing different UI, all works fine i am able to swap between both Datatemplates.

My concern is the while swapping between the templates i want to add animation to give a feeling of change in UI, but right now it happens in one click its just applies other template at once which does not give a feeling of change in UI Transition.

So what i want to do whenever a different DataTemplate is applied to Listbox i want to apply transition animation which gives a feel of change in UI similar to what we do in Mobile application where when you select an item from Listbox it shows new list of items with a Transition effect.

I hope i am able to explain myself.

If anyone has done that short of work please help me how can i achieve the same transition effect while swapping two DataTemplates with each other.

Thank you

Upvotes: 0

Views: 413

Answers (1)

Silver Solver
Silver Solver

Reputation: 2320

The Silverlight toolkit has a TransitioningContentControl that does exactly what you are after. I think the WPF toolkit has one too, but cant find it right now.

You might consider converting the SL control to WPF - should be easy enough. Or you could try this one from Codeproject instead

Upvotes: 1

Related Questions