Exemplo n.º 1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="seq_"></param>
        public void OpenGraphInNewTab(SequenceBase seq_)
        {
            foreach (TabItem item in tabControl.Items)
            {
                if ((item.DataContext as FlowGraphControlViewModel).ID == seq_.Id)
                {
                    tabControl.SelectedItem = item;
                    return;
                }
            }

            TabItem tab = new TabItem();
            FlowGraphControlViewModel fgvm = FlowGraphManager.Instance.GetViewModelByID(seq_.Id);

            tab.DataContext = fgvm;

            FlowGraphControl fgc = new FlowGraphControl();

            fgc.DataContext = fgvm;
            tab.Content     = fgc;

            Binding bind = new Binding("Name");

            bind.Source = fgvm;
            tab.SetBinding(TabItem.HeaderProperty, bind);

            tabControl.SelectedIndex = tabControl.Items.Add(tab);
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="seq_"></param>
        public void OpenGraphInNewTab(SequenceBase seq_)
        {
            foreach (TabItem item in tabControl.Items)
            {
                if ((item.DataContext as FlowGraphControlViewModel).ID == seq_.Id)
                {
                    tabControl.SelectedItem = item;
                    return;
                }
            }

            TabItem tab = new TabItem();
            FlowGraphControlViewModel fgvm = FlowGraphManager.Instance.GetViewModelByID(seq_.Id);
            tab.DataContext = fgvm;

            FlowGraphControl fgc = new FlowGraphControl();
            fgc.DataContext = fgvm;
            tab.Content = fgc;

            Binding bind = new Binding("Name");
            bind.Source = fgvm;
            tab.SetBinding(TabItem.HeaderProperty, bind);

            tabControl.SelectedIndex = tabControl.Items.Add(tab);
        }