I can not seem to find how Caliburn supports my preferred way of working with screens consisting of (nested) usercontrols.
The following situation provides a problem for me
- I have a clean shellview
- I have defined a usercontrol "MyView" It has a button with x:Name="DoStuff".
- I have also defined a viewmodel "MyViewModel" with a method public void DoStuff
- When I include the usercontrol into the shellview I get an exception when pressing my button.
As I understand Caliburn.micro is looking for the DoStuff method on my ShellViewModel class, not on my MyViewModel class.
After experiencing this I googled and found this thread (http://caliburn.codeplex.com/discussions/243482) where I learned that traversing usercontrols would create too much of a UI tree traversal
and was not done for performance reasons.
I read through the "Screens, Conductors and Composition" in the documentation but as far as I can see this does not provide me with a solution for creating screens which consist of usercontrols which may be used in more than one screen. All it
seems to refer to is how a screen would interact with other screens. The composition of a single screen is not really explained.
I've also read about the view-first way where you set the associated viewmodel in the xaml of your view.
It is however stated that the view-first way of working is not the default and to me it sounds like it is a workaround for solve my issue.
What is the caliburn way of working when it comes to using usercontrols in your screens?