Caliburn.Micro - How to activate an item from a class other than Explorer

I created the user interface of my Caliburn.Micro application, so the toolbar buttons have their own View and ViewModel.

In the examples I saw to activate a new screen, the method in the shell calls Conductor.ActivateItem, passing the viewmodel instance, however in my case the method ToolbarButtonViewModel.Submit()refers to a class that is not a shell.

What is the best way to activate screens from a class other than the shell?

+3
source share
2 answers

EventAggregator. , vm. , , .

+13

( ). , , :

  • .NET-. , ShellViewModel ToolBarViewModel, ToolBarViewModel ShellViewModel .
  • (, EventAggregator, Caliburn.Micro). ShellViewModel ToolBarViewModel
  • ToolBarViewModel ShellViewModel (, Conductor<T>.Collection.AllActive). ToolBarViewModel Screen Parent (, ).
+1

All Articles