private void TreeView_MouseDoubleClick(object sender, System.Windows.Input.MouseButtonEventArgs e)
        {
            if (myTreeView.SelectedItem != null)
            {
                if (myTreeView.SelectedItem is IBlocksFolder)
                {
                    IBlocksFolder            fld = (IBlocksFolder)myTreeView.SelectedItem;
                    DockableContentBlockList tmp = new DockableContentBlockList(fld);
                    tmp.parentDockingManager = parentDockingManager;
                    tmp.Title = fld.ToString(); //.Substring(fld.ToString().LastIndexOf("\\") + 1);
                    if (myTreeView.SelectedItem is BlocksOfflineFolder)
                    {
                        tmp.ToolTip = ((BlocksOfflineFolder)myTreeView.SelectedItem).Folder;
                    }
                    else
                    {
                        tmp.ToolTip = fld.ToString();
                    }
                    tmp.Show(parentDockingManager);
                    tmp.ToggleAutoHide();

                    //Set size of the parent DockablePane (it's automaticly been created!)
                    DockablePane tmpPane = tmp.TryFindParent <DockablePane>();
                    ResizingPanel.SetEffectiveSize(tmpPane, new Size(350, 0));

                    parentDockingManager.ActiveDocument = tmp;
                }
                else if (myTreeView.SelectedItem is ISymbolTable)
                {
                    ISymbolTable             fld = (ISymbolTable)myTreeView.SelectedItem;
                    ContentWindowSymbolTable tmp = new ContentWindowSymbolTable(fld);
                    tmp.Title   = fld.ToString(); //.Substring(fld.ToString().LastIndexOf("\\") + 1);
                    tmp.ToolTip = fld.ToString();
                    tmp.Show(parentDockingManager);
                    parentDockingManager.ActiveDocument = tmp;
                }
                else if (myTreeView.SelectedItem is ReferenceData)
                {
                    ReferenceData fld = (ReferenceData)myTreeView.SelectedItem;
                    ContentWindowReferenceData tmp = new ContentWindowReferenceData(fld);
                    tmp.parentDockingManager = parentDockingManager;

                    tmp.Title   = fld.ToString(); //.Substring(fld.ToString().LastIndexOf("\\") + 1);
                    tmp.ToolTip = fld.ToString();
                    tmp.Show(parentDockingManager);
                    parentDockingManager.ActiveDocument = tmp;
                }
                else if (myTreeView.SelectedItem is S7VATBlock)
                {
                    S7VATBlock          fld = (S7VATBlock)myTreeView.SelectedItem;
                    ContentWindowVarTab tmp = new ContentWindowVarTab(fld);
                    tmp.Title   = fld.ToString(); //.Substring(fld.ToString().LastIndexOf("\\") + 1);
                    tmp.ToolTip = fld.ToString();
                    tmp.Show(parentDockingManager);
                    parentDockingManager.ActiveDocument = tmp;
                }
            }
        }
        private void TreeView_MouseDoubleClick(object sender, System.Windows.Input.MouseButtonEventArgs e)
        {
            if (myTreeView.SelectedItem!=null)
            {
                if (myTreeView.SelectedItem is IBlocksFolder)
                {
                    IBlocksFolder fld = (IBlocksFolder) myTreeView.SelectedItem;
                    DockableContentBlockList tmp = new DockableContentBlockList(fld);
                    tmp.parentDockingManager = parentDockingManager;
                    tmp.Title = fld.ToString(); //.Substring(fld.ToString().LastIndexOf("\\") + 1);
                    if (myTreeView.SelectedItem is BlocksOfflineFolder)
                        tmp.ToolTip = ((BlocksOfflineFolder) myTreeView.SelectedItem).Folder;
                    else
                        tmp.ToolTip = fld.ToString();                    
                    tmp.Show(parentDockingManager);
                    tmp.ToggleAutoHide();

                    //Set size of the parent DockablePane (it's automaticly been created!)
                    DockablePane tmpPane = tmp.TryFindParent<DockablePane>();                    
                    ResizingPanel.SetEffectiveSize(tmpPane,new Size(350,0));

                    parentDockingManager.ActiveDocument = tmp;

                }
                else if (myTreeView.SelectedItem is ISymbolTable)
                {
                    ISymbolTable fld = (ISymbolTable)myTreeView.SelectedItem;
                    ContentWindowSymbolTable tmp = new ContentWindowSymbolTable(fld);
                    tmp.Title = fld.ToString(); //.Substring(fld.ToString().LastIndexOf("\\") + 1);
                    tmp.ToolTip = fld.ToString();                   
                    tmp.Show(parentDockingManager);
                    parentDockingManager.ActiveDocument = tmp;
                }
                else if (myTreeView.SelectedItem is ReferenceData)
                {
                    ReferenceData fld = (ReferenceData)myTreeView.SelectedItem;
                    ContentWindowReferenceData tmp = new ContentWindowReferenceData(fld);
                    tmp.parentDockingManager = parentDockingManager;
                  
                    tmp.Title = fld.ToString(); //.Substring(fld.ToString().LastIndexOf("\\") + 1);
                    tmp.ToolTip = fld.ToString();
                    tmp.Show(parentDockingManager);
                    parentDockingManager.ActiveDocument = tmp;
                }
                else if (myTreeView.SelectedItem is S7VATBlock)
                {
                    S7VATBlock fld = (S7VATBlock)myTreeView.SelectedItem;
                    ContentWindowVarTab tmp = new ContentWindowVarTab(fld);
                    tmp.Title = fld.ToString(); //.Substring(fld.ToString().LastIndexOf("\\") + 1);
                    tmp.ToolTip = fld.ToString();
                    tmp.Show(parentDockingManager);
                    parentDockingManager.ActiveDocument = tmp;
                }
            }
        }