protected override async void OnNavigatedTo(NavigationEventArgs e) { base.OnNavigatedTo(e); CoreView.TitleBar.LayoutMetricsChanged += TitleBar_LayoutMetricsChanged; CoreView.TitleBar.IsVisibleChanged += TitleBar_IsVisibleChanged; AppView.VisibleBoundsChanged += AppView_VisibleBoundsChanged; SystemNavigationManager.GetForCurrentView().BackRequested += HostTabPage_BackRequested; Window.Current.CoreWindow.PointerPressed += CoreWindow_PointerPressed; TabViewStartHeader.Margin = new Thickness(CoreView.TitleBar.SystemOverlayLeftInset, 0, 0, 0); TabViewEndHeader.Margin = new Thickness(0, 0, CoreView.TitleBar.SystemOverlayRightInset, 0); Data.Fullscreen = AppView.IsFullScreenMode; Window.Current.SetTitleBar(TitleBar); WeakReferenceMessenger.Default.Register(this); await Service.Dispatcher.RunAsync(() => { Data.OpenTab(Tab.Archives); if (Settings.OpenBookmarksTab) { Data.OpenTab(Tab.Bookmarks, false); } if (Settings.OpenCategoriesTab) { Data.OpenTab(Tab.Categories, false); } }); var info = await Updates.CheckForUpdates(); if (info.Result) { ShowNotification(lang.GetString("HostTab/Update1").AsFormat(info.Target?.ToString() ?? "Nightly"), lang.GetString("HostTab/Update2"), 0); } await ShowWhatsNew(); }
private async void HostTabPage_AttachedToVisualTree(object sender, VisualTreeAttachmentEventArgs e) { if (Design.IsDesignMode) { return; } //WeakReferenceMessenger.Default.Register(this); await Service.Dispatcher.RunAsync(() => { Data.OpenTab(Tab.Archives); /*if (Settings.OpenBookmarksTab) * Data.AddTab(new BookmarksTab(), false); * if (Api.ControlFlags.CategoriesEnabled) * if (Settings.OpenCategoriesTab) * Data.AddTab(new CategoriesTab(), false);*/ }); }
private void OpenTab() => Tabs.OpenTab(Tab.SearchResults, false, Category);