public void InitializeDesignMode()
        {
            _keyboardManager = new KeyboardManager(this);
            DesignViewModel = new DesignViewViewModel(this);
            Model.SelectedItem += Model_SelectedItem;
            Model.Initialize();

            var mediator = Mediator.Instance; //new Mediator(Model);
            mediator.DesignView = this;
            mediator.Initialize3DController();
            MenuManager = new Controllers.MenuManager(mediator.Controller3D);

            mediator.Add3DView(projectpreview.mainView3D);
            //if(this.mainview2D.DrawingControl!=null)
            //mediator.Add2DView(this.mainview2D);
        }
        private void UserControl_Loaded(object sender, RoutedEventArgs e)
        {
            ViewModel = new DesignViewViewModel(this);

            Model.SelectedItem += Model_SelectedItem;

            InitialBuildingConfiguration();

            Model.Initialize();

            var mediator = Mediator.Instance; //new Mediator(Model);
            mediator.DesignView = this;
            mediator.Initialize3DController(new Controller3DBabylon() { ActionManager = mediator.ActionManager });
            var MenuManager = new Controllers.MenuManager(mediator.Controller3D);

            //MenuManager.AttachMenuToView(mainView3D);
            mediator.Add3DView(mainView3D);
            //mediator.AddTreeView(this.MainTreeView);
            //mediator.SectionEditorController.Initialize(_ThermalSectionEditor);
            //mediator.SectionEditorController.Create3DController(_ThermalSectionEditor.BalderView);
            //mediator.SectionEditorController.SelectedSection=SectionEditorController.TestCompositeThermalSection();
            //mediator.SectionEditorController.SetUpScene();

            mediator.Add2DView(mainview2D);
            //mainview2D.ShowToolbar = false;

            //mediator.AddTreeView(mainTreeView);
        }
        private void UserControl_Loaded(object sender, RoutedEventArgs e)
        {
            ViewModel = new DesignViewViewModel(this);

            Model.SelectedItem += Model_SelectedItem;

            InitialBuildingConfiguration();

            Model.Initialize();

            var mediator = Mediator.Instance;
            mediator.DesignView = this;
            ViewModel.TreeViewd = MyTreeView;
            //MyTreeView.ItemsSource = ViewModel.CreateRootTreeViewItem();
               UpdateTreeView();
            // MyTreeView.ExpandAll();
            // mediator.AddTreeView(this.buildingTreeView1);
        }