Exemplo n.º 1
0
        private AndroidView CreateScrollViewContent()
        {
            View content = _ZoomScrollView.Content;

            if (content != null)
            {
                IVisualElementRenderer renderer = FormsPlatform.GetRenderer(content);

                if (renderer == null)
                {
                    renderer = FormsPlatform.CreateRendererWithContext(content, Context);
                    FormsPlatform.SetRenderer(content, renderer);
                }

                if (renderer.View.Parent != null)
                {
                    renderer.View.RemoveFromParent();
                }

                _contentTracker = new VisualElementTracker(renderer);
                _contentTracker.UpdateLayout();

                return(renderer.View);
            }

            return(null);
        }
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                Element.ChildAdded        -= PagesChanged;
                Element.ChildRemoved      -= PagesChanged;
                Element.ChildrenReordered -= PagesChanged;

                if (_rootLayout != null)
                {
                    RemoveAllViews();
                    foreach (Page pageToRemove in Element.Children)
                    {
                        var pageRenderer = Platform.GetRenderer(pageToRemove);
                        if (pageRenderer != null)
                        {
                            pageRenderer.View.RemoveFromParent();
                            pageRenderer.Dispose();
                        }
                    }

                    if (_bottomNav != null)
                    {
                        _bottomNav.SetOnNavigationItemSelectedListener(null);
                        _bottomNav.Dispose();
                        _bottomNav = null;
                    }
                    _rootLayout.Dispose();
                    _rootLayout = null;
                }
            }

            base.Dispose(disposing);
        }
Exemplo n.º 3
0
        public static IVisualElementRenderer GetOrCreateRenderer(this VisualElement bindable, Android.Content.Context context)
        {
            var renderer = XFPlatform.GetRenderer(bindable);

            if (renderer == null)
            {
                renderer = XFPlatform.CreateRendererWithContext(bindable, context);
                XFPlatform.SetRenderer(bindable, renderer);
            }
            return(renderer);
        }
Exemplo n.º 4
0
        public static IVisualElementRenderer GetOrCreateRenderer(this VisualElement bindable)
        {
            var renderer = XFPlatform.GetRenderer(bindable);

            if (renderer == null)
            {
                renderer = XFPlatform.CreateRendererWithContext(bindable, CrossCurrentActivity.Current.Activity);
                XFPlatform.SetRenderer(bindable, renderer);
            }
            return(renderer);
        }
Exemplo n.º 5
0
        public static IVisualElementRenderer GetOrCreateRenderer(this VisualElement bindable)
        {
            var renderer = XFPlatform.GetRenderer(bindable);

            if (renderer == null)
            {
                renderer = XFPlatform.CreateRenderer(bindable);
                XFPlatform.SetRenderer(bindable, renderer);
            }
            return(renderer);
        }
Exemplo n.º 6
0
        public static IVisualElementRenderer GetOrCreateRenderer(this VisualElement bindable, bool deneme = false)
        {
            var renderer = XFPlatform.GetRenderer(bindable);

            if (renderer == null || deneme)
            {
                if (renderer != null)
                {
                    renderer.Dispose();
                    //renderer = null;
                }
                renderer = XFPlatform.CreateRendererWithContext(bindable, CrossCurrentActivity.Current.Activity);
                XFPlatform.SetRenderer(bindable, renderer);
            }
            return(renderer);
        }
        public static void ChangePage(this ExtendedTabbedPageRenderer renderer, FrameLayout pageContainer, Page page)
        {
            renderer.Context.HideKeyboard(renderer);
            if (page == null)
            {
                return;
            }

            if (Platform.GetRenderer(page) == null)
            {
                Platform.SetRenderer(page, Platform.CreateRendererWithContext(page, renderer.Context));
            }

            var pageContent = Platform.GetRenderer(page).View;

            pageContainer.AddView(pageContent);
            if (pageContainer.ChildCount > 1)
            {
                pageContainer.RemoveViewAt(0);
            }

            EnsureTabIndex(renderer);
        }