Пример #1
0
 private void OnTabCloseRequested(WinUI.TabView sender, WinUI.TabViewTabCloseRequestedEventArgs args)
 {
     if (args.Item is TabViewItemData item)
     {
         Tabs.Remove(item);
     }
 }
Пример #2
0
 private void TabView_AddTabButtonClick(Microsoft.UI.Xaml.Controls.TabView sender, object args)
 {
     MessageCenter.OpenNewWindow(this, new NavigationInfo()
     {
         page  = typeof(BlankPage),
         title = "新建页面"
     });
 }
Пример #3
0
 private void TabView_TabCloseRequested(Microsoft.UI.Xaml.Controls.TabView sender, Microsoft.UI.Xaml.Controls.TabViewTabCloseRequestedEventArgs args)
 {
     sender.TabItems.Remove(args.Tab);
     if (sender.TabItems.Count == 0)
     {
         Application.Current.Exit();
     }
 }
        void TabView_AddButtonClick(TabView sender, object args)
        {
            var item = new TabViewItemDataTemplate()
            {
                Header = "Viewport", Content = new View_Port(m_main), Symbol = Symbol.View
            };

            m_TabView.TabItems.Add(CreateNewTab(item));
        }
Пример #5
0
 //点击了关闭tab的按钮时
 private void editorTabView_TabCloseRequested(muxc.TabView sender, muxc.TabViewTabCloseRequestedEventArgs args)
 {
     RequestCloseSession(args.Tab.Tag as CodeEditSessionInfo);
     //如果最后一个也关掉了。
     if (editorTabView.TabItems.Count == 0)
     {
         AllSessionClosed?.Invoke();
         editorPresenter.Content = null;
     }
 }
Пример #6
0
        private void TabControl_TabCloseRequested(muxc.TabView sender, muxc.TabViewTabCloseRequestedEventArgs args)
        {
            sender.TabItems.Remove(args.Tab);
            currentSelectedTab     = null;
            currentSelectedWebView = null;

            if (args.Tab.Name == "settingsTab")
            {
                settingTabCount = 0;
            }
        }
Пример #7
0
        private void OnAddTabButtonClick(Microsoft.UI.Xaml.Controls.TabView sender, object args)
        {
            int newIndex = Tabs.Any() ? Tabs.Max(t => t.Index) + 1 : 1;

            Tabs.Add(new TabViewItemData()
            {
                Index   = newIndex,
                Header  = $"Item {newIndex}",
                Content = $"This is the content for Item {newIndex}"
            });
        }
Пример #8
0
 private void TabStrip_TabCloseRequested(Microsoft.UI.Xaml.Controls.TabView sender, Microsoft.UI.Xaml.Controls.TabViewTabCloseRequestedEventArgs args)
 {
     if (TabStrip.TabItems.Count == 1)
     {
         Application.Current.Exit();
     }
     else if (TabStrip.TabItems.Count > 1)
     {
         int tabIndexToClose = TabStrip.TabItems.IndexOf(args.Tab);
         TabStrip.TabItems.RemoveAt(tabIndexToClose);
     }
 }
Пример #9
0
 private async void TabStrip_TabCloseRequested(Microsoft.UI.Xaml.Controls.TabView sender, Microsoft.UI.Xaml.Controls.TabViewTabCloseRequestedEventArgs args)
 {
     if (TabStrip.TabItems.Count == 1)
     {
         await InstanceTabsView.StartTerminateAsync();
     }
     else if (TabStrip.TabItems.Count > 1)
     {
         int tabIndexToClose = TabStrip.TabItems.IndexOf(args.Tab);
         TabStrip.TabItems.RemoveAt(tabIndexToClose);
     }
 }
Пример #10
0
 private async void TabStrip_TabCloseRequested(Microsoft.UI.Xaml.Controls.TabView sender, Microsoft.UI.Xaml.Controls.TabViewTabCloseRequestedEventArgs args)
 {
     if (TabStrip.TabItems.Count == 1)
     {
         await ApplicationView.GetForCurrentView().TryConsolidateAsync();
     }
     else if (TabStrip.TabItems.Count > 1)
     {
         int tabIndexToClose = TabStrip.TabItems.IndexOf(args.Tab);
         TabStrip.TabItems.RemoveAt(tabIndexToClose);
     }
 }
Пример #11
0
        private void TabViewControl_AddTabButtonClick(muxc.TabView sender, object args)
        {
            var newTab = new muxc.TabViewItem();

            newTab.Header = "Nowe SVG";
            Frame newFrame = new Frame();

            newTab.Content = newFrame;
            newFrame.Navigate(typeof(NavPage));
            sender.TabItems.Add(newTab);
            TabViewControl.SelectedItem = newTab;
        }
Пример #12
0
    private async void TabViewMain_TabCloseRequested(winui.Controls.TabView sender, winui.Controls.TabViewTabCloseRequestedEventArgs args)
    {
        if (RootAppWindow == null && TabViewMain.TabItems.Count == 1)
        {
            OpenTabExplorer();
            await CloseTab(args.Tab);

            TabViewMain.SelectedIndex = 0;
        }
        else
        {
            await CloseTab(args.Tab);
        }
    }
Пример #13
0
        private void TabView_AddTabButtonClick_1(Microsoft.UI.Xaml.Controls.TabView sender, object args)
        {
            TabViewItem tab = new TabViewItem();

            tab.Header = "Новая вкладка";
            WebView web = new WebView();

            tab.Content = web;
            sender.TabItems.Add(tab);
            web.Navigate(new Uri(findsys.findsystem));
            web.NavigationStarting += Web_SetAdress;
            web.NavigationFailed   += Web_Send;
            web.NewWindowRequested += Web_OpenWindow;
        }
Пример #14
0
        private void TabView_AddTabButtonClick(MUXC.TabView sender, object args)
        {
            var newTab = new MUXC.TabViewItem();

            newTab.IconSource = new MUXC.SymbolIconSource()
            {
                Symbol = Symbol.Document
            };
            newTab.Header = "New Document";

            // The Content of a TabViewItem is often a frame which hosts a page.

            sender.TabItems.Add(newTab);
        }
Пример #15
0
        private void editorTabView_AddTabButtonClick(muxc.TabView sender, object args)
        {
            var info = new CodeEditSessionInfo()
            {
                Contact = new ContactPage.ContactItemViewModel()
                {
                    UserID = count.ToString(),
                },
                CreateTime = DateTime.Now,
                Language   = "csharp",
                Code       = "using System;"
            };

            RequestOpenSession(info);
            count++;
        }
        internal Control_TabViewPage(View_Main _main, params TabViewItemDataTemplate[] _icollection)
        {
            m_main = _main;

            m_TabView = new TabView()
            {
                TabWidthMode = TabViewWidthMode.Equal, CloseButtonOverlayMode = TabViewCloseButtonOverlayMode.Auto, IsAddTabButtonVisible = false
            };
            m_TabView.AddTabButtonClick += TabView_AddButtonClick;
            //m_TabView.TabCloseRequested += TabView_TabCloseRequested;


            foreach (var item in _icollection)
            {
                m_TabView.TabItems.Add(CreateNewTab(item));
            }
        }
Пример #17
0
        private void TabView_AddTabButtonClick(muxc.TabView sender, object args)
        {
            var newTab = new muxc.TabViewItem();

            newTab.IconSource = new muxc.SymbolIconSource()
            {
                Symbol = Symbol.Document
            };
            newTab.Header = "Explore";

            // The Content of a TabViewItem is often a frame which hosts a page.
            Frame frame = new Frame();

            newTab.Content = frame;
            frame.Navigate(typeof(Page));

            sender.TabItems.Add(newTab);
        }
Пример #18
0
        private void TabControl_AddTabButtonClick(muxc.TabView sender, object args)
        {
            var newTab = new muxc.TabViewItem();

            newTab.IconSource = new muxc.SymbolIconSource()
            {
                Symbol = Symbol.Document
            };
            newTab.Header = "Blank Page";

            WebView webView = new WebView();

            string path = $"ms-appx-web:///Assets/BlankPage.html";


            newTab.Content = webView;
            webView.Navigate(new Uri(path));

            sender.TabItems.Add(newTab);

            sender.SelectedItem = newTab;
        }
Пример #19
0
        private async void SymbolsTab_AddTabButtonClick(WinUI.TabView sender, object args)
        {
            var textBox = new TextBox {
                AcceptsReturn = false, Text = "GOOGL"
            };
            var dialog = new ContentDialog
            {
                Content = textBox,
                Title   = "Add a new stock symbol",
                IsSecondaryButtonEnabled = true,
                PrimaryButtonText        = "Let's see",
                SecondaryButtonText      = "No thanks"
            };

            if (await dialog.ShowAsync() == ContentDialogResult.Primary)
            {
                var newTab = new WinUI.TabViewItem();
                newTab.Header = textBox.Text;
                sender.TabItems.Add(newTab);
                sender.SelectedIndex = sender.TabItems.Count - 1;
            }
        }
Пример #20
0
 private void MdiArea_TabCloseRequested(muxc.TabView sender, muxc.TabViewTabCloseRequestedEventArgs args)
 {
     ViewModel.CloseTab(args.Tab.DataContext);
 }
 void TabView_TabCloseRequested(TabView sender, TabViewTabCloseRequestedEventArgs args)
 {
     sender.TabItems.Remove(args.Tab);
 }
Пример #22
0
 //-----------------------Menu 1--------------------------------
 private void TabView_TabCloseRequested(MUXC.TabView sender, MUXC.TabViewTabCloseRequestedEventArgs args)
 {
 }
Пример #23
0
 private void TabViewMain_AddTabButtonClick(winui.Controls.TabView sender, object args)
 {
     OpenTabExplorer();
 }
Пример #24
0
 private void SymbolsTab_TabCloseRequested(WinUI.TabView sender, WinUI.TabViewTabCloseRequestedEventArgs args)
 {
     sender.TabItems.Remove(args.Item);
 }
Пример #25
0
 private void TabControl_AddTabButtonClick(muxc.TabView sender, object args)
 {
     AddNewTab(new Uri(homeUrl));
 }
Пример #26
0
 internal void SetParentTabView(TabView tabView)
 {
     m_parentTabView = tabView;
 }
Пример #27
0
 private void TabControl_TabCloseRequested(muxc.TabView sender, muxc.TabViewTabCloseRequestedEventArgs args)
 {
     sender.TabItems.Remove(args.Tab);
 }
Пример #28
0
 private void MainTabView_TabItemsChanged(TabView sender, IVectorChangedEventArgs args)
 {
 }
Пример #29
0
 private void MainTabView_TabDroppedOutside(TabView sender, TabViewTabDroppedOutsideEventArgs args)
 {
 }
Пример #30
0
 private void MainTabView_AddTabButtonClick(TabView sender, object args)
 {
     sender.TabItems.Add(CreateDefaultTab());
 }