I have a Caliburn.Micro shell (i.e., an empty XAML view to contain other views) rendered by a Conductor ViewModel. From there I open a Screen via:
ActivateItem(...)
Usually from the newly displayed dialog the user can perform some operations and click buttons (OK, Cancel, Build....) which should each transition to another screen (in the shell).
public MyDialog : Screen
{
public void Ok()
{
// TODO: Somehow tell the conductor or called of this class about this action.
}
}
What are good ways to achieve these kind of dialog action/message screen transitions?
- Simple .NET events are possible -- Wouldn't that be a bad idea?
- CM
IEventAggregatorshould also work by changing the view - Checking from the shell Conductor the ViewModel result once it has been closed via
TryClose()-- Should be possible, just don't know how to achieve this in CM. - Reference the shell Conductor instance from that screen (via IoC or directly) -- That seems strong coupling.
Could you please advise.
IEventAggregator: mindscapehq.com/blog/index.php/2012/02/01/… - Wernight