Beispiel #1
0
        protected virtual void AddItem(ManagedContent content)
        {
            TabItem   item     = new TabItem();
            DockPanel tabPanel = new DockPanel();

            // Added by Lucka
            Binding tabBinding = new Binding("Title");

            tabBinding.Source = content;
            item.SetBinding(TabItem.HeaderProperty, tabBinding);

            content.SetContainerPane(this);
            (content as DocumentContent).SetParentTab(item);
            // end by Lucka

            // Original code
            //item.Header = content.Title;

            item.Content = new ContentPresenter();
            (item.Content as ContentPresenter).Content = content.Content;
            item.Style = FindResource("DocTabItemStyle") as Style;

            tbcDocuments.Items.Add(item);
            tbcDocuments.SelectedItem = item;

            if (tbcDocuments.Items.Count == 1)
            {
                tbcDocuments.Visibility = Visibility.Visible;
            }

            //item.GotFocus += new RoutedEventHandler(item_GotFocus);
            //item.Focus();
            //DockManager.InvokeActiveTabChanged(item);
        }
Beispiel #2
0
        public DockablePane(ManagedContent content, Dock dock)
        {
            Dock = dock;
            _tabs.TabStripPlacement = Dock.Bottom;

            Add(content);
        }
Beispiel #3
0
        public Pane Add(ManagedContent content, Dock dock)
        {
            DockablePane pane = new DockablePane(content, dock);

            Add(pane);

            return(pane);
        }
Beispiel #4
0
        public Pane Add(ManagedContent content, Dock dock)
        {
            DockablePane pane = new DockablePane(content, dock);

            Add(pane);

            return pane;
        }
Beispiel #5
0
 protected override void DragContent(ManagedContent content)
 {
     if (content is DocumentContent)
     {
         return;
     }
     base.DragContent(content);
 }
        public DockablePane(ManagedContent content, Dock dock)
        {
            Dock = dock;
            _tabs.TabStripPlacement = Dock.Bottom;


            Add(content);
        }
Beispiel #7
0
        public virtual IPane FindPaneFromContent(ManagedContent content)
        {
            if (Contents.Contains(content))
            {
                return(this);
            }

            return(null);
        }
Beispiel #8
0
        protected void AddItem(ManagedContent content)
        {
            TabItem item = new TabItem();

            item.Header  = content.Title;
            item.Content = content.WindowContent;

            _tabs.Items.Add(item);
            _tabs.SelectedItem = item;
        }
Beispiel #9
0
        public IPane FindPaneFromContent(ManagedContent content)
        {
            IPane pane = First.FindPaneFromContent(content);
            if (pane != null)
                return pane;

            pane = Second.FindPaneFromContent(content);
            if (pane != null)
                return pane;

            return null;
        }
Beispiel #10
0
 protected void RemoveItem(ManagedContent content)
 {
     foreach (TabItem item in _tabs.Items)
     {
         if (item.Content == content.WindowContent)
         {
             item.Content = null;
             _tabs.Items.Remove(item);
             break;
         }
     }
 }
Beispiel #11
0
        void item_Close(object sender, RoutedEventArgs e)
        {
            TabItem        item    = (sender as Button).TemplatedParent as TabItem;
            ManagedContent content = Contents[_tabs.Items.IndexOf(item)];

            Remove(content);

            if (OnCloseContent != null)
            {
                OnCloseContent(this, new ContentEventArgs(content));
            }
        }
Beispiel #12
0
        protected virtual void RemoveItem(ManagedContent content)
        {
            TabItem tabItem = tbcDocuments.Items[Documents.IndexOf(content)] as TabItem;

            tabItem.Content = null;

            tbcDocuments.Items.Remove(tabItem);

            if (tbcDocuments.Items.Count == 0)
            {
                tbcDocuments.Visibility = Visibility.Collapsed;
            }
        }
Beispiel #13
0
        void item_MouseMove(object sender, MouseEventArgs e)
        {
            if (mouseItemIsDown)
            {
                if (Point.Subtract(e.GetPosition(this), ptStart).Length < 5)
                {
                    return;
                }

                TabItem        item    = (sender as Border).TemplatedParent as TabItem;
                ManagedContent content = Contents[_tabs.Items.IndexOf(item)];

                DragContent(content);
            }
        }
Beispiel #14
0
        protected virtual void DragContent(ManagedContent content)
        {
            Remove(content);

            mouseItemIsDown      = false;
            panelDrag.Visibility = Visibility.Visible;

            if (DragDrop.DoDragDrop(this, content, DragDropEffects.Move) == DragDropEffects.None)
            {
                FireOnDragAbortEvent();
                Add(content);
            }


            panelDrag.Visibility = Visibility.Collapsed;
        }
        public IPane FindPaneFromContent(ManagedContent content)
        {
            IPane pane = First.FindPaneFromContent(content);

            if (pane != null)
            {
                return(pane);
            }

            pane = Second.FindPaneFromContent(content);
            if (pane != null)
            {
                return(pane);
            }

            return(null);
        }
Beispiel #16
0
        protected virtual void AddItem(ManagedContent content)
        {
            TabItem   item     = new TabItem();
            DockPanel tabPanel = new DockPanel();

            item.Header  = content.Title;
            item.Content = new ContentPresenter();
            (item.Content as ContentPresenter).Content = content.Content;
            item.Style = FindResource("DocTabItemStyle") as Style;

            tbcDocuments.Items.Add(item);
            tbcDocuments.SelectedItem = item;

            if (tbcDocuments.Items.Count == 1)
            {
                tbcDocuments.Visibility = Visibility.Visible;
            }
        }
        public override void Remove(ManagedContent content)
        {
            base.Remove(content);

            RemoveItem(content);

            if (Contents.Count == 1)
            {
                RemoveItem(Contents[0]);
                HideTabs();
                windowContent.Content = Contents[0].WindowContent;
                tbTitle.Text          = Contents[0].Title;
            }
            else if (Contents.Count == 0)
            {
                windowContent.Content = null;
            }
        }
Beispiel #18
0
        public override void Add(ManagedContent content)
        {
            base.Add(content);

            if (Contents.Count == 1)
            {
                tbTitle.Text = content.Title;
                windowContent.Content = content.WindowContent;
            }
            else if (Contents.Count == 2)
            {
                ShowTabs();
                AddItem(Contents[0]);
                AddItem(content);
            }
            else
                AddItem(content);
        }
Beispiel #19
0
        /*void item_GotFocus(object sender, RoutedEventArgs e)
         * {
         *  DockManager.InvokeActiveTabChanged(sender as TabItem);
         * }*/

        protected virtual void RemoveItem(ManagedContent content)
        {
            TabItem tabItem = tbcDocuments.Items[Documents.IndexOf(content)] as TabItem;

            tabItem.Content = null;

            tbcDocuments.Items.Remove(tabItem);

            if (tbcDocuments.Items.Count == 0)
            {
                tbcDocuments.Visibility = Visibility.Collapsed;
                // Added by Lucka
                //DockManager.InvokeActiveTabChanged(null);
            }
            else
            {
                //DockManager.InvokeActiveTabChanged(tbcDocuments.Items[tbcDocuments.Items.Count - 1] as TabItem);
            }
        }
        public override void Add(ManagedContent content)
        {
            base.Add(content);

            if (Contents.Count == 1)
            {
                tbTitle.Text          = content.Title;
                windowContent.Content = content.WindowContent;
            }
            else if (Contents.Count == 2)
            {
                ShowTabs();
                AddItem(Contents[0]);
                AddItem(content);
            }
            else
            {
                AddItem(content);
            }
        }
Beispiel #21
0
        void OnDocumentSwitch(object sender, EventArgs e)
        {
            int index = cxDocumentSwitchMenu.Items.IndexOf((sender as MenuItem));

            TabItem tabItem = tbcDocuments.Items[index] as TabItem;

            tbcDocuments.Items.RemoveAt(index);
            tbcDocuments.Items.Insert(0, tabItem);
            tbcDocuments.SelectedIndex = 0;

            ManagedContent contentToSwap = Documents[index];

            Documents.RemoveAt(index);
            Documents.Insert(0, contentToSwap);

            foreach (MenuItem item in cxDocumentSwitchMenu.Items)
            {
                item.Click -= new RoutedEventHandler(OnDocumentSwitch);
            }
        }
Beispiel #22
0
        public virtual IPane FindPaneFromContent(ManagedContent content)
        {
            if (Contents.Contains(content))
                return this;

            return null;
        }
Beispiel #23
0
        public override void Remove(ManagedContent content)
        {
            base.Remove(content);

            RemoveItem(content);

            if (Contents.Count == 1)
            {
                RemoveItem(Contents[0]);
                HideTabs();
                windowContent.Content = Contents[0].WindowContent;
                tbTitle.Text = Contents[0].Title;
            }
            else if (Contents.Count==0)
                windowContent.Content = null;
        }
        public override void Remove(ManagedContent content)
        {
            base.Remove(content);

            RemoveItem(content);
        }
        public override void Add(ManagedContent content)
        {
            base.Add(content);

            AddItem(content);
        }
Beispiel #26
0
        public override void Add(ManagedContent content)
        {
            base.Add(content);

            AddItem(content);
        }
Beispiel #27
0
        public override void Remove(ManagedContent content)
        {
            base.Remove(content);

            RemoveItem(content);
        }
Beispiel #28
0
        protected virtual void AddItem(ManagedContent content)
        {
            TabItem item = new TabItem();
            DockPanel tabPanel = new DockPanel();
            item.Header = content.Title;
            item.Content = new ContentPresenter();
            (item.Content as ContentPresenter).Content = content.Content;
            item.Style = FindResource("DocTabItemStyle") as Style;

            tbcDocuments.Items.Add(item);
            tbcDocuments.SelectedItem = item;

            if (tbcDocuments.Items.Count == 1)
                tbcDocuments.Visibility = Visibility.Visible;
        }
Beispiel #29
0
 public virtual void Add(ManagedContent content)
 {
     Contents.Add(content);
 }
Beispiel #30
0
 public virtual void Add(ManagedContent content)
 {
     Contents.Add(content);
 }
Beispiel #31
0
 public virtual void Remove(ManagedContent content)
 {
     Contents.Remove(content);
 }
Beispiel #32
0
        protected void AddItem(ManagedContent content)
        {
            TabItem item = new TabItem();
            item.Header = content.Title;
            item.Content = content.WindowContent;

            _tabs.Items.Add(item);
            _tabs.SelectedItem = item;
        }
Beispiel #33
0
 public ContentEventArgs(ManagedContent content)
 {
     Content = content;
 }
Beispiel #34
0
        protected virtual void DragContent(ManagedContent content)
        {
            Remove(content);

            mouseItemIsDown = false;
            panelDrag.Visibility = Visibility.Visible;

            if (DragDrop.DoDragDrop(this, content, DragDropEffects.Move) == DragDropEffects.None)
            {
                FireOnDragAbortEvent();
                Add(content);
            }

            panelDrag.Visibility = Visibility.Collapsed;
        }
Beispiel #35
0
 public virtual void Remove(ManagedContent content)
 {
     Contents.Remove(content);
 }
Beispiel #36
0
 protected void RemoveItem(ManagedContent content)
 {
     foreach (TabItem item in _tabs.Items)
         if (item.Content == content.WindowContent)
         {
             item.Content = null;
             _tabs.Items.Remove(item);
             break;
         }
 }
Beispiel #37
0
 public IPane FindPaneFromContent(ManagedContent content)
 {
     return(_rootPane.FindPaneFromContent(content));
 }
Beispiel #38
0
 public ContentEventArgs(ManagedContent content)
 {
     Content = content;
 }
Beispiel #39
0
        protected virtual void RemoveItem(ManagedContent content)
        {
            TabItem tabItem = tbcDocuments.Items[Documents.IndexOf(content)] as TabItem;

            tabItem.Content = null;

            tbcDocuments.Items.Remove(tabItem);

            if (tbcDocuments.Items.Count == 0)
                tbcDocuments.Visibility = Visibility.Collapsed;
        }
 protected override void DragContent(ManagedContent content)
 {
     if (content is DocumentContent)
         return;
     base.DragContent(content);
 }
Beispiel #41
0
 public IPane FindPaneFromContent(ManagedContent content)
 {
     return _rootPane.FindPaneFromContent(content);
 }
		public static void Show(ManagedContent  w)
		{
			w.DockManager = _dockManager;
			w.Show();
		}