I am creating a small app using WPF, Prism and MVVM. There is a control (a loader) that I would like to reuse each time a command is being executed and I would like to place that user control on top of a certain region with some transparency.
Namely, the region where the current module which calls the command.
How can I add this User control on top of a certain region from the ViewModel(is this the right place?)?
You’re correct that with Prism, the best way to do this is with regions.
Just create the region in your view, give it a unique name.
Then, in the ViewModel use the RegionManager to add the usercontrol.
I should also point out that since this is in MVVM, you should probably want to add the usercontrol using some kind of IoC such as MEF or Unity.