I’m using MVVM via Caliburn Micro on WP7. I have a popup that is shown from the VM. On the popup is a performance progress bar. The progress bar does not show when IsIndeterminate is set to true because the popup is not in the visual tree (it is a custom control).
If I grab the view from the view model and force the popup into the visual tree the progress bar displays correctly. I don’t really want to do this though.
What is the best way to do this whilst preserving the separation of view and view model. Is there some way the popup can insert itself into the root page or frame?
I ended up creating a base popup class and adding this code in:
It’s a bit hard coded as it looks for a MainGrid grid control. This could be improved to look for an appropriate top level container.
There are 2 helper classes at play here. UserControlHelper has the following methods:
FindVisualChild comes from a VisualTreeHelperExtension class that came with Phone7.Fx.preview that I use for its bindable app bar.