• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Controls.TabItem类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中System.Windows.Controls.TabItem的典型用法代码示例。如果您正苦于以下问题:C# TabItem类的具体用法?C# TabItem怎么用?C# TabItem使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



TabItem类属于System.Windows.Controls命名空间,在下文中一共展示了TabItem类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: MainTab

 public MainTab(int page, TabItem newTab, Image newVerso, Image newRecto, Grid canvas, Grid vGrid, Grid rGrid, Button delBtn, ScatterView SV, ScatterViewItem si, Grid vSwipeGrid, Grid rSwipeGrid, Grid vTranslationGrid, Grid rTranslationGrid, Grid vBoxesGrid, Grid rBoxesGrid, TextBlock headerText, SurfaceWindow1.language language)
 {
     _page = page;
     _tab = newTab;
     _verso = newVerso;
     _recto = newRecto;
     _canvas = canvas;
     _vGrid = vGrid;
     _rGrid = rGrid;
     _SVI = si;
     _delButton = delBtn;
     numFingersRecto = 0;
     numFingersVerso = 0;
     fingerPos = new List<Point>();
     avgTouchPoint = new Point(-1, 0);
     _vSwipeGrid = vSwipeGrid;
     _rSwipeGrid = rSwipeGrid;
     _vTranslationGrid = vTranslationGrid;
     _rTranslationGrid = rTranslationGrid;
     _vBoxesGrid = vBoxesGrid;
     _rBoxesGrid = rBoxesGrid;
     _twoPage = true;
     _SV = SV;
     _headerTB = headerText;
     _currentLanguage = language;
     _previousLanguage = _currentLanguage;
     _worker = new Workers(this);
 }
开发者ID:straboulsi,项目名称:fauvel,代码行数:28,代码来源:Tab.cs


示例2: CreateTabItem

 public static TabItem CreateTabItem(WrapPanel headerPanel, Grid textBoxGrid)
 {
     TabItem tabItem = new TabItem();
     tabItem.Header = headerPanel;
     tabItem.Content = textBoxGrid;
     return tabItem;
 }
开发者ID:vasily-kirichenko,项目名称:vsClojure,代码行数:7,代码来源:ReplUserInterfaceFactory.cs


示例3: AddTabItem

        private void AddTabItem(string header, UserControl aUserControl)
        {
            if (string.IsNullOrEmpty(header) || null == aUserControl)
            {
                return;
            }

            var list = this.planListTabControl.Items.Where(w => ((TabItem)w).Header.ToString() == header);
            if (list.Count() > 0)
            {
                ((TabItem)list.First()).Visibility = Visibility.Visible;

                this.planListTabControl.SelectedItem = list.First();
            }
            else
            {
                TabItem tabItem = new TabItem();

                tabItem.Header = header;
                var tabContent = aUserControl;

                tabItem.Content = tabContent;
                this.planListTabControl.Items.Add(tabItem);
                this.planListTabControl.SelectedItem = tabItem;
            }
        }
开发者ID:YHTechnology,项目名称:ProjectManager,代码行数:26,代码来源:PlanListEvaluateWindow.xaml.cs


示例4: TabState

 protected TabState()
 {
     var tabItem = new TabItem();
     TabItem = tabItem;
     TabItem.Header = this;
     tabItem.DataContext = this;
 }
开发者ID:BahNahNah,项目名称:dnSpy,代码行数:7,代码来源:TabState.cs


示例5: MainWindow

        public MainWindow()
        {
            InitializeComponent();

                // initialize tabItem array
                _tabItems = new List<TabItem>();

                // add a tabItem with + in header
                _tabAdd = new TabItem();
                //get image for header and setup add button
                _tabAdd.Style = new Style();
                _tabAdd.Background = new SolidColorBrush(Color.FromArgb(0xFF, 0x30, 0x30, 0x30));
                _tabAdd.BorderBrush = new SolidColorBrush(Color.FromArgb(0xFF, 0x30, 0x30, 0x30));
                BitmapImage bitmap = new BitmapImage();
                bitmap.BeginInit();
                bitmap.UriSource = new Uri(@"pack://application:,,,/Explore10;component/Images/appbar.add.png");
                bitmap.EndInit();
                Image plus = new Image();
                plus.Source = bitmap;
                plus.Width = 25;
                plus.Height = 25;
                _tabAdd.Width = 35;
                _tabAdd.Header = plus;
                _tabAdd.MouseLeftButtonUp += new MouseButtonEventHandler(tabAdd_MouseLeftButtonUp);
                _tabItems.Add(_tabAdd);

                // add first tab
                //this.AddTabItem();

                // bind tab control
                tabDynamic.DataContext = _tabItems;

                tabDynamic.SelectedIndex = 0;
        }
开发者ID:PFCKrutonium,项目名称:Explore10,代码行数:34,代码来源:MainWindow.xaml.cs


示例6: AddCustomTab

        public void AddCustomTab(TabControl parentTabControl, string name, UserControl userControl, bool useViewBox = true)
        {
            if (useViewBox)
            {
                Viewbox viewBox = new Viewbox();
                viewBox.Child = userControl;
                viewBox.Width = double.NaN;
                viewBox.Height = double.NaN;

                TabItem tabItem = new TabItem();
                tabItem.Header = name;
                tabItem.Content = viewBox;
                CopyFontData(tabItem1, tabItem);
                parentTabControl.Items.Add(tabItem);
            }
            else
            {
                userControl.Width = double.NaN;
                userControl.Height = double.NaN;
                userControl.HorizontalAlignment = System.Windows.HorizontalAlignment.Stretch;
                userControl.VerticalAlignment = System.Windows.VerticalAlignment.Stretch;

                Grid grid = new Grid();
                grid.Width = double.NaN;
                grid.Height = double.NaN;
                grid.HorizontalAlignment = System.Windows.HorizontalAlignment.Stretch;
                grid.VerticalAlignment = System.Windows.VerticalAlignment.Stretch;

                grid.Children.Add(userControl);
                Grid.SetColumn(userControl, 0);
                Grid.SetRow(userControl, 0);

                AddCustomTab(parentTabControl, name, grid);
            }
        }
开发者ID:vesteksoftware,项目名称:VT5021,代码行数:35,代码来源:ManualExtended.cs


示例7: AddTabItem

        private TabItem AddTabItem()
        {
            int count = _tabcount;
            Debug.WriteLine(count);
            // create new tab item
            var tab = new TabItem
            {
                Header = "C:\\",
                Name = $"tab{count}",
                HeaderTemplate = tabDynamic.FindResource("TabHeader") as DataTemplate
            };



            var view = new ExploreView {Name = "Explore"};
            view.FillView(@"C:\");
            view.VerticalAlignment = VerticalAlignment.Stretch;
            view.HorizontalAlignment = HorizontalAlignment.Stretch;

            tab.Content = view;

            // insert tab item right before the last (+) tab item
            _tabItems.Insert(_tabItems.Count-1, tab);
            _tabcount += 1;
            return tab;
        }
开发者ID:Toyz,项目名称:Explore10,代码行数:26,代码来源:MainWindow.xaml.cs


示例8: CreateTabHeader

        private static FrameworkElement CreateTabHeader(TabItem tabItem, bool closeViewModelOnUnload)
        {
            Argument.IsNotNull("tabItem", tabItem);

            var stackPanel = new StackPanel();
            stackPanel.Orientation = Orientation.Horizontal;

            var titleLabel = new Label();
            titleLabel.Content = string.Format("Close on unload: {0}", closeViewModelOnUnload);
            stackPanel.Children.Add(titleLabel);

            var closeButton = new Button();
            closeButton.Content = "X";
            closeButton.ToolTip = "Close";
            closeButton.Click += (sender, e) =>
                                     {
                                         var tabControl = tabItem.FindLogicalAncestorByType<System.Windows.Controls.TabControl>();
                                         if (tabControl != null)
                                         {
                                             var tabItemAsIUserControl = tabItem.Content as IUserControl;
                                             if ((tabItemAsIUserControl != null) && (tabItemAsIUserControl.ViewModel != null))
                                             {
                                                 tabItemAsIUserControl.ViewModel.CloseViewModel(false);
                                             }

                                             tabControl.Items.Remove(tabItem);
                                         }
                                     };
            stackPanel.Children.Add(closeButton);

            return stackPanel;
        }
开发者ID:ruisebastiao,项目名称:Catel.Examples,代码行数:32,代码来源:MainWindow.xaml.cs


示例9: JournalDetails

        public JournalDetails(User user, int journalID)
            : base(user, "Journal:" + journalID)
        {
            InitializeComponent();
            Journal model = null;

            if (journalID >= 0) {
                var service = new SupportService(user);
                model = service.GetJournal(journalID);
            } else {
                model = new Journal();
                model.JournalID = -1;
                model.FullName = "<New Journal>";
            }

            _viewModel = new JournalViewModel(model);

            _traits = tabJournal.AddTabItem("Traits", new TraitControl(user, TraitCategoryType.Journal, _viewModel));
            _notes = tabJournal.AddTabItem("Notes", new NotesControl(user, TraitCategoryType.Journal, _viewModel));
            tabJournal.AddTabItem("Ownership", new OwnershipDetails(model));

            if (_viewModel.JournalID >= 0) {
                _viewModel.DataChanged += new DataChangedHandler(viewModel_DataChanged);
            } else {
                Loaded += new RoutedEventHandler(JournalDetails_Loaded);
                _traits.IsEnabled = false;
                _notes.IsEnabled = false;
            }

            ChangesCommitted += new PendingChangesCommittedHandler(JournalDetails_ChangesCommitted);

            this.DataContext = _viewModel;
        }
开发者ID:kehh,项目名称:biolink,代码行数:33,代码来源:JournalDetails.xaml.cs


示例10: VisualisationDataControl

        public VisualisationDataControl()
        {
            InitializeComponent();

            VisualisationPlotControl ecgVPControl = new VisualisationPlotControl();
            VisualisationTableControl ecgVTControl = new VisualisationTableControl();
            VisualisationHistogramControl ecgVHControl = new VisualisationHistogramControl();

            visulisationDataTabsList = new List<TabItem>();

            TabItem ecgBaselineTab = new TabItem();
            ecgBaselineTab.Header = "Plot";
            ecgBaselineTab.Content = ecgVPControl;
            visulisationDataTabsList.Add(ecgBaselineTab);

            TabItem tableControl = new TabItem();
            tableControl.Header = "Table";
            tableControl.Content = ecgVTControl;
            visulisationDataTabsList.Add(tableControl);

            TabItem histogramControl = new TabItem();
            histogramControl.Header = "Histogram";
            histogramControl.Content = ecgVHControl;
            visulisationDataTabsList.Add(histogramControl);

            this.EcgDataDynamicTab.DataContext = visulisationDataTabsList;
        }
开发者ID:Nefarin,项目名称:DadmProject,代码行数:27,代码来源:VisualisationDataControl.xaml.cs


示例11: InvokeAddTab

        void InvokeAddTab(ChatUser friend, string message)
        {
            if (FindMatchingChatControl(friend.Summary.SteamId) != null) return;

            if (!chatTabs.Dispatcher.CheckAccess())
                chatTabs.Dispatcher.Invoke(() =>
                {
                    var tabItem = new TabItem { Header = friend.Summary.PersonaName };
                    var chatControl = new ChatControl(this, tabItem, ChatHandler, friend);
                    tabItem.Content = chatControl;
                    chatTabs.Items.Add(tabItem);
                    if (!string.IsNullOrEmpty(message))
                        InvokeHandleMessage(chatControl, message);
                    chatTabs.SelectedIndex = chatTabs.Items.Count - 1;
                });
            else
            {
                var tabItem = new TabItem { Header = friend.Summary.PersonaName };
                var chatControl = new ChatControl(this, tabItem, ChatHandler, friend);
                tabItem.Content = chatControl;
                chatTabs.Items.Add(tabItem);
                if (!string.IsNullOrEmpty(message))
                    InvokeHandleMessage(chatControl, message);
                chatTabs.SelectedIndex = chatTabs.Items.Count - 1;
            }
        }
开发者ID:revoraffles,项目名称:CSharpTradeOffers,代码行数:26,代码来源:ChatWindow.xaml.cs


示例12: Add_Tab_Button

 private void Add_Tab_Button(object sender, RoutedEventArgs e)
 {
     TabItem item = new TabItem();
     item.Content = new HorizontalSplitterBrowser();
     item.Header = "Tab-" + this.tabControl.Items.Count.ToString("000");
     this.tabControl.Items.Insert(this.tabControl.Items.Count-1, item);
 }
开发者ID:kamiyonanayo,项目名称:ExampleWpfApplication1_Dynamic_Add,代码行数:7,代码来源:TabBrowser.xaml.cs


示例13: AddTabItem

        private void AddTabItem(string header, PlanListViewModel aPlanListViewModel)
        {
            if (string.IsNullOrEmpty(header) || null == aPlanListViewModel)
            {
                return;
            }

            var list = this.planListTabControl.Items.Where(w => ((TabItem)w).Header.ToString() == header);
            if (list.Count() > 0)
            {
                ((TabItem)list.First()).Visibility = Visibility.Visible;

                this.planListTabControl.SelectedItem = list.First();
            }
            else
            {
                TabItem tabItem = new TabItem();

                tabItem.Header = header;

                PlanListStatisticsDataGrid planListDataGrid = new PlanListStatisticsDataGrid(aPlanListViewModel, null != planExtraEntity);

                var tabContent = planListDataGrid as UserControl;

                tabItem.Content = tabContent;
                this.planListTabControl.Items.Add(tabItem);
                this.planListTabControl.SelectedItem = tabItem;
            }
        }
开发者ID:YHTechnology,项目名称:ProjectManager,代码行数:29,代码来源:PlanListStatisticsWindow.xaml.cs


示例14: Page1_Click

        private void Page1_Click(object sender, RoutedEventArgs e)
        {
            const string tabName = "Transactions";

            if (!TabExists(tabName))
            {
                TabItem tabitem = new TabItem();
                tabitem.Header = tabName ;
                Frame tabFrame = new Frame();
                Transactions page1 = new Transactions();
                tabFrame.Content = page1;
                tabitem.Content = tabFrame;
                tabitem.Name =tabName;
                tabControlView.Items.Add(tabitem);
                tabControlView.SelectedItem = tabitem;
            }
            else
            {
                List<TabItem> tabitem = (from TabItem item in tabControlView.Items
                                   where item.Name.Equals(tabName)
                                   select item).ToList();
                if (tabitem.Any())
                {
                    tabControlView.SelectedItem = tabitem.First();
                }

            }
                //MessageBox.Show("Tab is Already Open or Too Many Tabs", "Error", MessageBoxButton.OK, MessageBoxImage.Exclamation);
        }
开发者ID:sriharshakolluru,项目名称:Dinesh-Project,代码行数:29,代码来源:MainWindow.xaml.cs


示例15: AWindow

        public AWindow(IWindow owner)
            : base(owner, Core.settings)
        {
            TabItem from_me = new TabItem();
            from_me.BeginInit();
            from_me.EndInit();
            this.Background = from_me.Background;
            ProgressBar from_color = new ProgressBar();
            default_progress_color = from_color.Foreground;

            // Taskbar progress setup
            TaskbarItemInfo = new TaskbarItemInfo();
            //            var uriSource = new Uri(System.IO.Path.Combine(Core.ExecutablePath, "masgau.ico"), UriKind.Relative);

            System.Drawing.Icon ico = Properties.Resources.MASGAUIcon;

            this.Icon = System.Windows.Interop.Imaging.CreateBitmapSourceFromHBitmap(
                    ico.ToBitmap().GetHbitmap(),
                    IntPtr.Zero,
                    Int32Rect.Empty,
                    BitmapSizeOptions.FromEmptyOptions());

            if (owner != null) {
                this.Owner = owner as System.Windows.Window;
                this.WindowStartupLocation = System.Windows.WindowStartupLocation.CenterOwner;
            } else {
                this.WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen;
            }
        }
开发者ID:raven-ie,项目名称:MASGAU,代码行数:29,代码来源:AWindow.cs


示例16: DynamicTabsControl

        public DynamicTabsControl()
        {
            // newTab = typeof(ImageWorkspaceControl);

            try
            {
                InitializeComponent();

                // initialize tabItem array
                _tabItems = new List<TabItem>();

                // add a tabItem with + in header
                TabItem tabAdd = new TabItem();
                tabAdd.Header = "+";

                _tabItems.Add(tabAdd);

                //// bind tab control
                tabDynamic.DataContext = _tabItems;

                tabDynamic.SelectedIndex = 0;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
开发者ID:Nedja995,项目名称:npcv-gui-wpf,代码行数:27,代码来源:DynamicTabsControl.xaml.cs


示例17: Convert

        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            try
            {
                var source = (IEnumerable)value;
                if (source != null)
                {
                    var tabItems = new List<TabItem>();

                    foreach (object item in source)
                    {
                        var tabItem = new TabItem
                                          {
                                              DataContext = item,
                                              Content = new ContentControl { Template = (ControlTemplate)parameter }
                                          };

                        var binding = new Binding("DisplayName");
                        tabItem.SetBinding(TabItem.HeaderProperty, binding);

                        tabItems.Add(tabItem);
                    }

                    return tabItems;
                }
                return null;
            }
            catch (Exception)
            {
                return null;
            }
        }
开发者ID:ValdimarThor,项目名称:Cocktail,代码行数:32,代码来源:SourceToTabItemsConverter.cs


示例18: ConsoleControl

        public ConsoleControl()
        {
            try
            {
                InitializeComponent();

                // initialize tabItem array
                _tabItems = new List<TabItem>();

                // add a tabItem with + in header 
                _tabAdd = new TabItem();
                _tabAdd.Header = "+";
                // tabAdd.MouseLeftButtonUp += new MouseButtonEventHandler(tabAdd_MouseLeftButtonUp);

                _tabItems.Add(_tabAdd);

                // add first tab
                this.AddTabItem();

                // bind tab control
                tabDynamic.DataContext = _tabItems;

                tabDynamic.SelectedIndex = 0;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
开发者ID:jackyshi,项目名称:jackyshi.github.com,代码行数:29,代码来源:ConsoleControl.xaml.cs


示例19: SetupArea

        private void SetupArea(DockPosition position, ContentControl contentArea)
        {
            var extensionForThisArea = Extensions.Where(e => e.Metadata.Position == position).ToList();
            if (extensionForThisArea.Count == 0)
            {
                contentArea.Visibility = System.Windows.Visibility.Collapsed;
            }
            else if (extensionForThisArea.Count == 1)
            {
                contentArea.Content = extensionForThisArea[0].Value;
            }
            else
            {
                TabControl tabControl = new TabControl();
                foreach (var extension in extensionForThisArea)
                {
                    var tabItem = new TabItem();
                    tabItem.Header = extension.Metadata.Name;
                    tabItem.Content = extension.Value;

                    tabControl.Items.Add(tabItem);
                }
                contentArea.Content = tabControl;
            }
        }
开发者ID:dsplaisted,项目名称:MEFBook,代码行数:25,代码来源:MainWindow.xaml.cs


示例20: Button_Click

        private void Button_Click(object sender, RoutedEventArgs e)
        {
            TabItem item = new TabItem();
            item.Content="name";

            this.tab.Items.Add(item);
        }
开发者ID:Deson621,项目名称:demo,代码行数:7,代码来源:grid.xaml.cs



注:本文中的System.Windows.Controls.TabItem类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Controls.TextBlock类代码示例发布时间:2022-05-26
下一篇:
C# Controls.TabControl类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap