Opening a UserControl from the code behind in MVVM and Caliburn.Micro
===

Ok, so I am embedding a microsoft drag and drop application into a WPF app. The drag and drop functionality is very difficult to achieve in the ViewModel, so I have it in the code behind. But now I need to open a UserControl popup window from the code behind. My attempt was to call a method in the ViewModel from the code behind to try and publish a new window event. Unfortunately, I get a null reference due to an unassigned IEventAggregator. Since I am using Caliburn.Micro, getting into the ViewModel is a priority and I want to get the event to publish.

In summation, how can I publish an event in the ViewModel from the code behind (without getting a null reference on the IEventAggregator)?


Code Behind:

    public partial class DrawingView : System.Windows.Controls.UserControl
    {
        IEventAggregator events;
        _model = new DrawingViewModel();
     ....

        private void ShapeDoubleClick(object sender, AxMicrosoft.Office.Interop.VisOcx.EVisOcx_MouseUpEvent e)
        {
            if (App.VisioControl.Document.Application.ActiveWindow.Selection.Count > 0)
            {
                _model.PublishComponentInfoEvent(events);
            }
        }


ViewModel:


        public void PublishComponentInfoEvent(IEventAggregator events)
        {
            events.Publish(new NewWindowEvent("ComponentInfoViewModel"));
        }

    