private void TabView_TabCloseRequested(Microsoft.UI.Xaml.Controls.TabView sender, Microsoft.UI.Xaml.Controls.TabViewTabCloseRequestedEventArgs args) { if (sender.TabItems.Count() > 1) { sender.TabItems.Remove(args.Tab); } }
private void MainTabControl_AddTabButtonClick(Microsoft.UI.Xaml.Controls.TabView sender, object args) { // TODO: Create new doc Docs.Add(new Doc() { Name = "Untitled", Uuid = "42c70071-ce5e-4add-aa5c-d093acfb2784" }); }
private void TabView_TabCloseRequested(Microsoft.UI.Xaml.Controls.TabView sender, Microsoft.UI.Xaml.Controls.TabViewTabCloseRequestedEventArgs args) { if (RootAppWindow == null && tabView.TabItems.Count == 1) { OpenTabNew(); CloseTab(args.Tab); tabView.SelectedIndex = 0; } else { CloseTab(args.Tab); } }
private TabViewItem FindTabViewItemFromContent(TabView tabView, object content) { var numItems = tabView.TabItems.Count; for (int i = 0; i < numItems; i++) { var tabItem = tabView.ContainerFromIndex(i) as TabViewItem; if (tabItem.Content == content) { return(tabItem); } } return(null); }
private void tabView_AddTabButtonClick(Microsoft.UI.Xaml.Controls.TabView sender, object args) { var newTab = new Microsoft.UI.Xaml.Controls.TabViewItem(); newTab.IconSource = new Microsoft.UI.Xaml.Controls.SymbolIconSource() { Symbol = Symbol.Document }; newTab.Header = "Blank Page"; Frame frame = new Frame(); newTab.Content = frame; frame.Navigate(typeof(BlankWEBPage), newTab); sender.TabItems.Add(newTab); }
private void TabView_AddTabButtonClick(Microsoft.UI.Xaml.Controls.TabView sender, object args) { OpenTabNew(); }
/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="args"></param> private void BrowserWidget_MainTabView_TabCloseRequested(Microsoft.UI.Xaml.Controls.TabView sender, Microsoft.UI.Xaml.Controls.TabViewTabCloseRequestedEventArgs args) { this._viewModel.TabViewTabCloseRequestedCommand.Execute(args); }
/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="args"></param> private void BrowserWidget_MainTabView_AddTabButtonClick(Microsoft.UI.Xaml.Controls.TabView sender, object args) { this._viewModel.TabViewAddTabClickCommand.Execute(args); }