Example #1
0
        void CleanUpPageController()
        {
            CleanUpPageControl();

            if (pageController != null)
            {
                pageController.DidFinishAnimating       -= PageController_DidFinishAnimating;
                pageController.GetPreviousViewController = null;
                pageController.GetNextViewController     = null;

                foreach (var child in pageController.ChildViewControllers)
                {
                    child.Dispose();
                }

                foreach (var child in pageController.ViewControllers)
                {
                    child.Dispose();
                }

                pageController.View.RemoveFromSuperview();
                pageController.View.Dispose();

                pageController.Dispose();
                pageController = null;
            }
        }
Example #2
0
        protected override void Dispose(bool disposing)
        {
            if (disposing && !_disposed)
            {
                // CarouselViewRenderer.Dispose Null reference Unhandled Exception: #210
                // Exception thrown on Dispose #233
                try
                {
                    pageController.DidFinishAnimating       -= PageController_DidFinishAnimating;
                    pageController.GetPreviousViewController = null;
                    pageController.GetNextViewController     = null;

                    CleanUpPageController();

                    pageController.View.RemoveFromSuperview();
                    pageController.View.Dispose();

                    pageController.Dispose();
                    pageController = null;
                } catch (Exception ex) {
                    Console.Write(ex.Message);
                }

                if (_collectionListenerSource != null)
                {
                    _collectionListenerSource.CollectionChanged -= ItemsSource_CollectionChanged;
                    _collectionListenerSource = null;
                }

                if (Element != null)
                {
                    Element.SizeChanged -= Element_SizeChanged;
                }

                Source = null;

                _disposed = true;
            }

            try
            {
                base.Dispose(disposing);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
                return;
            }
        }
Example #3
0
        protected override void Dispose(bool disposing)
        {
            if (disposing && !_disposed)
            {
                if (pageController != null)
                {
                    pageController.DidFinishAnimating       -= PageController_DidFinishAnimating;
                    pageController.GetPreviousViewController = null;
                    pageController.GetNextViewController     = null;

                    foreach (var child in pageController.ViewControllers)
                    {
                        child.Dispose();
                    }

                    pageController.Dispose();
                    pageController = null;
                }

                if (pageControl != null)
                {
                    pageControl.Dispose();
                    pageControl = null;
                }

                if (Element != null)
                {
                    Element.SizeChanged -= Element_SizeChanged;
                    if (Element.ItemsSource != null && Element.ItemsSource is INotifyCollectionChanged)
                    {
                        ((INotifyCollectionChanged)Element.ItemsSource).CollectionChanged -= ItemsSource_CollectionChanged;
                    }
                }

                Source = null;

                _disposed = true;
            }

            try
            {
                base.Dispose(disposing);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
                return;
            }
        }
Example #4
0
        protected override void Dispose(bool disposing)
        {
            if (disposing && !_disposed)
            {
                if (pageController != null)
                {
                    pageController.GetPresentationCount      = null;
                    pageController.GetPresentationIndex      = null;
                    pageController.DidFinishAnimating       -= PageController_DidFinishAnimating;
                    pageController.GetPreviousViewController = null;
                    pageController.GetNextViewController     = null;

                    foreach (var child in pageController.ViewControllers)
                    {
                        child.Dispose();
                    }

                    pageController.Dispose();
                    pageController = null;
                }

                if (pageControl != null)
                {
                    pageControl.Dispose();
                    pageControl = null;
                }

                if (nativeView != null)
                {
                    nativeView.Dispose();
                    nativeView = null;
                }

                _disposed = true;
            }

            try
            {
                base.Dispose(disposing);
            }
            catch (Exception ex)
            {
                return;
            }
        }
 protected override void Dispose(bool disposing)
 {
     if (disposing)
     {
         PageController?.SendDisappearing();
         if (Tabbed != null)
         {
             Tabbed.PropertyChanged      -= OnPropertyChanged;
             Tabbed.PagesChanged         -= OnPagesChanged;
             TabBar.TabsSelectionChanged -= HandleTabsSelectionChanged;
         }
         if (pageViewController != null)
         {
             pageViewController.WeakDataSource      = null;
             pageViewController.DidFinishAnimating -= HandlePageViewControllerDidFinishAnimating;
             pageViewController?.Dispose();
         }
     }
     base.Dispose(disposing);
 }
        protected override void Dispose(bool disposing)
        {
            if (disposing && !_disposed)
            {
                if (pageController != null)
                {
                    pageController.DidFinishAnimating       -= PageController_DidFinishAnimating;
                    pageController.GetPreviousViewController = null;
                    pageController.GetNextViewController     = null;

                    foreach (var child in pageController.ViewControllers)
                    {
                        child.Dispose();
                    }

                    pageController.Dispose();
                    pageController = null;
                }

                if (pageControl != null)
                {
                    pageControl.Dispose();
                    pageControl = null;
                }

                Source = null;

                _disposed = true;
            }

            try
            {
                base.Dispose(disposing);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
                return;
            }
        }