Esempio n. 1
0
		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;
		}
Esempio n. 2
0
		public PagesChangedEventArgs(
			INavigationPage oldPage,
			INavigationPage newPage,
			PagesChangeType changeType)
		{
			_changeType = changeType;
			_newPage = newPage;
			_oldPage = oldPage;
		}
Esempio n. 3
0
 public NavigationHistoryEntry(INavigationPage page)
 {
     Page = page;
 }
Esempio n. 4
0
 public async void NavigateTo(INavigationPage page)
 {
     _navigationHistory.Push(page);
     NavigationHistory.Insert(0, new NavigationHistoryEntry(page));
     await SetPage();
 }
Esempio n. 5
0
		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;
		}
Esempio n. 6
0
		private void RemovePage(INavigationPage page)
		{
			_openedPagesWithSubscriptions[page].Dispose();
			_openedPagesWithSubscriptions.Remove(page);
		}
Esempio n. 7
0
		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: выбирать другю вкладку, если активная была закрыта
					}));
		}
Esempio n. 8
0
        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);
 }
Esempio n. 11
0
 public virtual void NotifyPagePopped(INavigationPage poppedPage)
 {
 }
Esempio n. 12
0
 public OpenPageMessage(INavigationPage page)
 {
    Page = page;
 }
Esempio n. 13
0
 public override void NotifyPagePopped(INavigationPage poppedPage)
 {
     // just pop and be happy
     _navigationController.PopViewController(true);
 }