Message attach problem (WPF)

Topics: Actions & Coroutines
Sep 6, 2012 at 1:57 PM

hi,  I wanted to extend the WPF example presented at  caliburn-micro-part-4-the-event-aggregator:
 
 I just added a Listbox to the AppView.xaml :

 <ListBox cal:Action.Target="{Binding ListBoxViewModel}" cal:Message.Attach="[Event Loaded] = [Action ControlLoaded]" />

 
  But when the application starts Caliburn throws the exception: 

"No target found for method 'ControlLoaded'".

But the AppViewModel   contains  this prop

 public ListBoxViewModel ListBoxViewModel { get; set; }

which gets instantiated in the ctor of AppViewModel.

    
   
The ListBox VM itself:

   [Export(typeof(ListBoxViewModel))]
    public class ListBoxViewModel
    {
        private readonly IEventAggregator _events;
       [ImportingConstructor]
        public ListBoxViewModel(IEventAggregator events)
        {
            _events = events;
        }
        public void ControlLoaded()
        {
         
        }
    }

   
What's wrong with this ?