Exemplo n.º 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);
        }
Exemplo n.º 2
0
        public DockablePane(ManagedContent content, Dock dock)
        {
            Dock = dock;
            _tabs.TabStripPlacement = Dock.Bottom;

            Add(content);
        }
Exemplo n.º 3
0
        public Pane Add(ManagedContent content, Dock dock)
        {
            DockablePane pane = new DockablePane(content, dock);

            Add(pane);

            return(pane);
        }
Exemplo n.º 4
0
        public Pane Add(ManagedContent content, Dock dock)
        {
            DockablePane pane = new DockablePane(content, dock);

            Add(pane);

            return pane;
        }
Exemplo n.º 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);
        }
Exemplo n.º 7
0
        public virtual IPane FindPaneFromContent(ManagedContent content)
        {
            if (Contents.Contains(content))
            {
                return(this);
            }

            return(null);
        }
Exemplo n.º 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;
        }
Exemplo n.º 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;
        }
Exemplo n.º 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;
         }
     }
 }
Exemplo n.º 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));
            }
        }
Exemplo n.º 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;
            }
        }
Exemplo n.º 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);
            }
        }
Exemplo n.º 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;
        }
Exemplo n.º 15
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);
        }
Exemplo n.º 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;
            }
        }
Exemplo n.º 17
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;
            }
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
            }
        }
Exemplo n.º 20
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);
            }
        }
Exemplo n.º 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);
            }
        }
Exemplo n.º 22
0
        public virtual IPane FindPaneFromContent(ManagedContent content)
        {
            if (Contents.Contains(content))
                return this;

            return null;
        }
Exemplo n.º 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;
        }
Exemplo n.º 24
0
        public override void Remove(ManagedContent content)
        {
            base.Remove(content);

            RemoveItem(content);
        }
Exemplo n.º 25
0
        public override void Add(ManagedContent content)
        {
            base.Add(content);

            AddItem(content);
        }
Exemplo n.º 26
0
        public override void Add(ManagedContent content)
        {
            base.Add(content);

            AddItem(content);
        }
Exemplo n.º 27
0
        public override void Remove(ManagedContent content)
        {
            base.Remove(content);

            RemoveItem(content);
        }
Exemplo n.º 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;
        }
Exemplo n.º 29
0
 public virtual void Add(ManagedContent content)
 {
     Contents.Add(content);
 }
Exemplo n.º 30
0
 public virtual void Add(ManagedContent content)
 {
     Contents.Add(content);
 }
Exemplo n.º 31
0
 public virtual void Remove(ManagedContent content)
 {
     Contents.Remove(content);
 }
Exemplo n.º 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;
        }
Exemplo n.º 33
0
 public ContentEventArgs(ManagedContent content)
 {
     Content = content;
 }
Exemplo n.º 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;
        }
Exemplo n.º 35
0
 public virtual void Remove(ManagedContent content)
 {
     Contents.Remove(content);
 }
Exemplo n.º 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;
         }
 }
Exemplo n.º 37
0
 public IPane FindPaneFromContent(ManagedContent content)
 {
     return(_rootPane.FindPaneFromContent(content));
 }
Exemplo n.º 38
0
 public ContentEventArgs(ManagedContent content)
 {
     Content = content;
 }
Exemplo n.º 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;
        }
Exemplo n.º 40
0
 protected override void DragContent(ManagedContent content)
 {
     if (content is DocumentContent)
         return;
     base.DragContent(content);
 }
Exemplo n.º 41
0
 public IPane FindPaneFromContent(ManagedContent content)
 {
     return _rootPane.FindPaneFromContent(content);
 }
		public static void Show(ManagedContent  w)
		{
			w.DockManager = _dockManager;
			w.Show();
		}