public void ShowPage( IServiceProvider serviceProvider, string name, NavigationPageState state, bool replaceCurrentTab) { if (serviceProvider == null) throw new ArgumentNullException(nameof(serviceProvider)); if (name == null) throw new ArgumentNullException(nameof(name)); INavigationPage oldPage = null; var newPage = _navigationPageFactory.CreatePage(serviceProvider, name, state); if (replaceCurrentTab && CurrentPage != null) { oldPage = CurrentPage; RemovePage(oldPage); } AddPage(newPage); _openedPagesChanged.OnNext( new PagesChangedEventArgs( oldPage, newPage, oldPage != null ? PagesChangeType.Updated : PagesChangeType.Added)); CurrentPage = newPage; }
public PagesChangedEventArgs( INavigationPage oldPage, INavigationPage newPage, PagesChangeType changeType) { _changeType = changeType; _newPage = newPage; _oldPage = oldPage; }
public NavigationHistoryEntry(INavigationPage page) { Page = page; }
public async void NavigateTo(INavigationPage page) { _navigationHistory.Push(page); NavigationHistory.Insert(0, new NavigationHistoryEntry(page)); await SetPage(); }
public void ReloadPage(IServiceProvider serviceProvider, INavigationPage page) { if (page == null) throw new ArgumentNullException(nameof(page)); if (!_openedPagesWithSubscriptions.ContainsKey(page)) throw new ArgumentException("Страница не найдена.", nameof(page)); var newPage = _navigationPageFactory.CreatePage(serviceProvider, page.Name, page.State); RemovePage(page); AddPage(newPage); _openedPagesChanged.OnNext(new PagesChangedEventArgs(page, newPage, PagesChangeType.Updated)); if (CurrentPage == page) CurrentPage = newPage; }
private void RemovePage(INavigationPage page) { _openedPagesWithSubscriptions[page].Dispose(); _openedPagesWithSubscriptions.Remove(page); }
private void AddPage(INavigationPage page) { _openedPagesWithSubscriptions.Add( page, page.Disposed.Subscribe( arg => { RemovePage(page); _openedPagesChanged.OnNext( new PagesChangedEventArgs(page, null, PagesChangeType.Removed)); if (CurrentPage == page) CurrentPage = null; //ToDo: выбирать другю вкладку, если активная была закрыта })); }
public WebNavigationItemArgs(Control navigationItem, WebNavigation parentNavigation, INavigationPage pageData, bool isSelected, bool isInSelectedPath, int itemIndex, bool isFirstItem, bool isLastItem, bool expandingLevel, bool isChildOfRemovedNode, WebNavigation subNavigation) : base(pageData) { if (navigationItem == null) { throw new ArgumentNullException("navigationItem"); } if (parentNavigation == null) { throw new ArgumentNullException("parentNavigation"); } this.parentNavigation = parentNavigation; this.SubNavigation = subNavigation; this.navigationItem = navigationItem; this.IsSelected = isSelected; this.IsInSelectedPath = isInSelectedPath; this.IsChildOfRemovedNode = isChildOfRemovedNode; this.ItemIndex = itemIndex; this.IsFirstItem = isFirstItem; this.IsLastItem = isLastItem; this.ExpandingLevel = expandingLevel; }
public async Task Navigate(INavigationPage page, object parameter) { _shell.RootFrame.Navigate(page.PageType, parameter); }
public void Navigate(INavigationPage page) { navigationFrame.Navigate(page.PageType); }
public virtual void NotifyPagePopped(INavigationPage poppedPage) { }
public OpenPageMessage(INavigationPage page) { Page = page; }
public override void NotifyPagePopped(INavigationPage poppedPage) { // just pop and be happy _navigationController.PopViewController(true); }