Caliburn micro directing the message.attach to the desired viewmodel

Oct 17, 2012 at 10:05 AM

I've added another view named LogicView inside my MainView. I made a contextmenu for LogicView that will publish a message of "ConvertToCode()" when the menu item is clicked, but I'd like to send the message named ConvertToCode to my MainViewModel, not LogicViewModel. Otherwise, I have to use EventAggregator and publish the message from my LogicViewModel back to my MainViewModel, and this seems very redundant.


    <my:LogicView x:Name="logicView" AllowDrop="True">
              <ContextMenu StaysOpen="True">
                    <MenuItem Header="Convert To Code"
                     cal:Message.Attach="ConvertToCode()"/> //I'd like to send this to mainviewmodel

Is this possible to do in Caliburn Micro?

Oct 17, 2012 at 7:54 PM

you might have a look at and action.targetwithoutcontext otherwise eventaggregator.