internal void OnMove()
 {
     RelationControl.OnMove();
     if (GetBindingExpression(Canvas.LeftProperty) != null)
     {
         GetBindingExpression(Canvas.LeftProperty).UpdateTarget();
     }
     if (GetBindingExpression(Canvas.TopProperty) != null)
     {
         GetBindingExpression(Canvas.TopProperty).UpdateTarget();
     }
 }
        private void tvDefinitionNodeMouseClick(object sender, TreeNodeMouseClickEventArgs e)
        {
            TreeNode selectedNode = e.Node;

            selectedNode.TreeView.SelectedNode = selectedNode;
            var collec = (Dictionary <string, string>)selectedNode.Tag;

            TreeNodeHelper.AddContextMenu(e.Node, this);
            Control existingControl = panelContainer.Controls.Count > 0 ? panelContainer.Controls[0] : null;

            this.deleteToolStripMenuItem.Text = "Delete " + selectedNode.Text;

            UserControl ctrl = null;

            switch (selectedNode.Text.Split(' ')[0])
            {
            case "ShuffleDefinition":
                ctrl = new ShuffleDefinitionControl(collec, this);
                break;

            case "DataBlock":
                ctrl = new DataBlockControl(collec, this);
                break;

            case "SolutionBlock":
                ctrl = new SolutionBlockControl(collec, this);
                break;

            case "Export":
                if (selectedNode.Parent != null && selectedNode.Parent.Text.StartsWith("DataBlock"))
                {
                    ctrl = new DataBlockExportControl(collec, this);
                }
                else if (selectedNode.Parent != null && selectedNode.Parent.Text.StartsWith("SolutionBlock"))
                {
                    ctrl = new SolutionBlockExportControl(collec, this);
                }
                break;

            case "Import":
                if (selectedNode.Parent != null && selectedNode.Parent.Text.StartsWith("DataBlock"))
                {
                    ctrl = new DataBlockImportControl(collec, this);
                }
                else if (selectedNode.Parent != null && selectedNode.Parent.Text.StartsWith("SolutionBlock"))
                {
                    ctrl = new SolutionBlockImportControl(collec, this);
                }
                break;

            case "Relation":
                ctrl = new RelationControl(collec, selectedNode, this);
                break;

            case "Attribute":
                if (selectedNode.Parent != null && selectedNode.Parent.Text.StartsWith("Attributes"))
                {
                    ctrl = new ExportAttributeControl(collec, this);
                }
                else if (selectedNode.Parent != null && selectedNode.Parent.Text.StartsWith("Match"))
                {
                    ctrl = new ImportAttributeControl(collec, this);
                }
                break;

            case "Filter":
                ctrl = new FilterControl(collec, this);
                break;

            case "Sort":
                ctrl = new SortControl(collec, this);
                break;

            case "Match":
                ctrl = new ImportMatchControl(collec, this);
                break;

            case "Settings":
                ctrl = new SettingsControl(collec, this);
                break;

            case "Solution":
                if (selectedNode.Parent != null && selectedNode.Parent.Text.StartsWith("PreRequisites"))
                {
                    ctrl = new PreReqSolutionControl(collec, this);
                }
                break;

            default:
            {
                panelContainer.Controls.Clear();
                tsbItemSave.Visible = false;
            }
            break;
            }
            if (ctrl != null)
            {
                panelContainer.Controls.Add(ctrl);
                ctrl.BringToFront();
                if (existingControl != null)
                {
                    panelContainer.Controls.Remove(existingControl);
                }
                tsbItemSave.Visible = true;
            }

            ManageMenuDisplay();
        }