//***************************Element Space***************************************************************************************************************************************************************************
        public ElementSpace(TheoryTree tree, TheoryTreeController treeController, Session session)
        {
            InitializeComponent();
            allocator = new ElementAllocator(Children,this);
            //arrows = new Arrows(this);
            this.session = session;
            this.tree = tree;
            this.treeController = treeController;
            this.tree.ContentUpdated += new Protsenko.TheoryEditor.Core.Events.ContentUpdated(tree_ContentUpdated);
            focusedObjects = new List<TheoryVisualDecorator>();

            this.MouseRightButtonUp += new MouseButtonEventHandler(CanvasMy_MouseRightButtonUp);
            this.MouseLeftButtonDown += new MouseButtonEventHandler(dragpanel_MouseLeftButtonDown);
            this.MouseMove += new MouseEventHandler(dragpanel_MouseMove);
            this.MouseLeftButtonUp += new MouseButtonEventHandler(dragpanel_MouseLeftButtonUp);
            this.MouseLeave += new MouseEventHandler(CanvasMy_MouseLeave);
            this.MouseWheel += new MouseWheelEventHandler(CanvasMy_MouseWheel);
            this.LayoutUpdated += new EventHandler(ElementSpace_LayoutUpdated);     // not mvc //костыль
            this.ElementsFocused += new Protsenko.TheoryEditor.Core.Events.Focused(ElementSpace_ElementFocused);

            if (tree.Count != 0)
                tree.RunUpdateForeachElement();
        }
        public void SetMC(TheoryTree tree, TheoryTreeController treeController)
        {
            this.tree = tree;
            this.treeController = treeController;
            this.tree.ContentUpdated += new Protsenko.TheoryEditor.Core.Events.ContentUpdated(tree_ContentUpdated);

            this.Children.Clear();

            if (tree.Count != 0)
                tree.RunUpdateForeachElement();
        }