I have a WPF .NET 4.5 application following the MVVM pattern (MVVM_Light framework).
I have a User-control (Parent) that contains a content control; this content control is bound to a user-control(child) property in the underlying ViewModel. A button/command on the parent usercontrol changes the Content Control's bound usercontrol.
My problem is that the child viewmodel has a heavy database procedure in its constructor and thus the UI hangs while that usercontrol is loading. I want to display a loading animation while the child viewmodel is created and then loaded.
What I tried: I have tried adding blend animations to the loaded event of the usercontrol, but that did not work.
Also
I created a usercontrol that is a loading animation and placed it as the default content of the content control. But the animation stops when the button is clicked and the new usercontrol is loading.
QUESTION: How do I have a loading animation while another usercontrol is loading?