Пример #1
0
 public static void Stop()
 {
     // unwind stack
     Running = false;
     while (Stack.Count > 0)
     {
         Stack.Pop();
     }
 }
Пример #2
0
        protected override void Dispose(bool disposing)
        {
            if (_disposed)
            {
                return;
            }

            if (disposing)
            {
                var viewsToLookAt = new FormsStack <NSView>(Subviews);
                while (viewsToLookAt.Count > 0)
                {
                    var view             = viewsToLookAt.Pop();
                    var viewCellRenderer = view as ViewCellNSView;
                    if (viewCellRenderer != null)
                    {
                        viewCellRenderer.RemoveFromSuperview();
                        viewCellRenderer.Dispose();
                    }
                    else
                    {
                        foreach (var child in view.Subviews)
                        {
                            viewsToLookAt.Push(child);
                        }
                    }
                }
            }
            _disposed = true;

            base.Dispose(disposing);
        }
Пример #3
0
        protected override void Dispose(bool disposing)
        {
            if (disposing && _insetTracker != null)
            {
                _insetTracker.Dispose();
                _insetTracker = null;

                var viewsToLookAt = new FormsStack <UIView>(Subviews);
                while (viewsToLookAt.Count > 0)
                {
                    var view             = viewsToLookAt.Pop();
                    var viewCellRenderer = view as ViewCellRenderer.ViewTableCell;
                    if (viewCellRenderer != null)
                    {
                        viewCellRenderer.Dispose();
                    }
                    else
                    {
                        foreach (var child in view.Subviews)
                        {
                            viewsToLookAt.Push(child);
                        }
                    }
                }
            }

            base.Dispose(disposing);
        }
        async Task <bool> PopPageAsync(Page page, bool animated)
        {
            if (page == null)
            {
                throw new ArgumentNullException(nameof(page));
            }

            var wrapper = _currentStack.Peek();

            if (page != wrapper.Page)
            {
                throw new NotSupportedException("Popped page does not appear on top of current navigation stack, please file a bug.");
            }

            _currentStack.Pop();
            page.SendDisappearing();

            var target       = Platform.GetRenderer(page);
            var previousPage = _currentStack.Peek().Page;

            var previousPageRenderer = CreateViewControllerForPage(previousPage);

            ShowView(previousPageRenderer.ViewController);
            if (animated)
            {
                var transitionStyle = NavigationPage.OnThisPlatform().GetNavigationTransitionPopStyle();

                return(await this.HandleAsyncAnimation(target.ViewController, previousPageRenderer.ViewController,
                                                       ToViewControllerTransitionOptions(transitionStyle), () => target.DisposeRendererAndChildren(), true));
            }

            RemovePage(page, false);
            return(true);
        }