protected virtual void OnPagePopped(Page i_PoppedPage)
 {
     if (OnPopped != null)
     {
         ViewNavigationArgs viewNavigationArgs = new ViewNavigationArgs();
         viewNavigationArgs.PoppedView  = i_PoppedPage as IView;
         viewNavigationArgs.CurrentView = m_Page.CurrentPage as IView;
         viewNavigationArgs.Parameter   = r_ParameterQueue.Count > 0 ? r_ParameterQueue.Dequeue() : null;
         OnPopped.Invoke(this, viewNavigationArgs);
     }
 }
Example #2
0
        public Task SilentPopAsync(int indexFromTop)
        {
            var page = _page.Navigation.NavigationStack[_page.Navigation.NavigationStack.Count - indexFromTop - 1];

            _page.Navigation.RemovePage(page);
            // Because a remove page, doesn't issue a pop
            OnPopped?.Invoke(this, new ViewNavigationArgs()
            {
                PopType = PopType.SilentPop, Parameter = null, CurrentView = _page.CurrentPage as IView, PoppedView = page as IView
            });
            return(Task.FromResult(true));
        }
Example #3
0
        public T Pop()
        {
            if (_inactive.Count == 0)
            {
                return(null);                     // or throw exception?
            }
            var item = _inactive[0];

            _inactive.RemoveAt(0);
            _active.Add(item);

            item.gameObject.SetActive(true);
            OnPopped?.Invoke(item);

            return(item);
        }