Exemplo n.º 1
0
        private void UserControl_Loaded(object sender, RoutedEventArgs e)
        {
            var container = ContainerHelper.I;

            IRegionManager     mgr  = container.Resolve <IRegionManager>();
            MessageConsoleView view = new MessageConsoleView();

            container.BuildUp(view);
            mgr.AddView(view, "MessageConsoleRegion");
            //
            ToolboxView tbView = new ToolboxView();

            container.BuildUp(tbView);
            container.RegisterInstance <IToolboxService>(tbView);
            mgr.AddView(tbView, "ToolboxRegion");

            _propGrid = (PropertyGrid)PropertyGridRegion.Content;
            container.BuildUp(_propGrid);
            container.RegisterInstance <IDesignEditorService>(_propGrid);

            DesignSurface surface = new DesignSurface();

            container.BuildUp(surface);
            container.RegisterInstance <IDesigner>(surface);
            mgr.AddView(surface, "DesignSurfaceRegion");

            _globalMouse   = EventAggregator.Get <GlobalMousePostionChangedEvent, Point>();
            _leftMouseDown = EventAggregator.Get <MouseLeftButtonDownEvent, MouseButtonEventArgs>();
            _leftMouseUp   = EventAggregator.Get <MouseLeftButtonUpEvent, MouseButtonEventArgs>();

            container.BuildUp(Presenter);
            Presenter.InitializeDesignableControls();
        }