How to show animation during rendering?

I have a WPF ListBox that shows a lot of data. I need a smooth scroll, so I set ListBox.ScrollViewer.CanContentScroll to False, which disables virtualization. Now, when I open the tab where this ListBox is located, I can’t see anything in a few seconds, because the ListBox loads / creates items / rendering. I also have a control that shows some animation that indicates that the application is running and the user should wait a bit.

How can I show this control while the ListBox unavailable?

+7
animation wpf xaml rendering listbox
source share
2 answers

Add a grid to the location of your list and place your ListBox and your animation control inside it. Thus, they are located in one place. The animation control should be at the top of the z-order and displayed like this. Once the ListBox finishes loading, you will hide the animation control and a ListBox will appear instead. Each time you need to perform another long operation, you set the animation control again.

+2
source share

Clear shutdown in Silverlight and WPF applications

Check how the author of this application did this through code, maybe it can help you, although this is a different scenario.

0
source share

All Articles