예제 #1
0
        protected virtual void OnChildAdded(VisualElement view)
        {
            if (_isDisposed)
            {
                return;
            }

            if (CompressedLayout.GetIsHeadless(view))
            {
                var packager = new VisualElementPackager(Renderer, view);
                view.IsPlatformEnabled = true;
                packager.Load();
            }
            else
            {
                var viewRenderer = Platform.CreateRenderer(view);
                Platform.SetRenderer(view, viewRenderer);

                var uiview = Renderer.NativeView;
                uiview.AddSubview(viewRenderer.NativeView);

                if (Renderer.ViewController != null && viewRenderer.ViewController != null)
                {
                    Renderer.ViewController.AddChildViewController(viewRenderer.ViewController);
                }

                EnsureChildrenOrder();
            }
        }
예제 #2
0
        public VirtualizingStackLayout()
        {
            _visibleItems = new List <View>();
            _locations    = new Dictionary <View, Rectangle>();

            CompressedLayout.SetIsHeadless(this, true);
        }
예제 #3
0
 public static RelativeLayout IsHeadless(this RelativeLayout layout)
 {
     if (CoreSettings.OS == DeviceOS.ANDROID)
     {
         CompressedLayout.SetIsHeadless(layout, true);
     }
     return(layout);
 }
        void AddChild(VisualElement view, IVisualElementRenderer oldRenderer = null, RendererPool pool = null, bool sameChildren = false)
        {
            var reference = Guid.NewGuid().ToString();

            Performance.Start(reference);

            if (CompressedLayout.GetIsHeadless(view))
            {
                var packager = new VisualElementPackager(_renderer, view);
                if (_childPackagers == null)
                {
                    _childPackagers = new Dictionary <BindableObject, VisualElementPackager>();
                }
                view.IsPlatformEnabled = true;
                packager.Load();

                _childPackagers[view] = packager;
            }
            else
            {
                if (_childViews == null)
                {
                    _childViews = new List <IVisualElementRenderer>();
                }

                IVisualElementRenderer renderer = oldRenderer;
                if (pool != null)
                {
                    renderer = pool.GetFreeRenderer(view);
                }
                if (renderer == null)
                {
                    Performance.Start(reference, "New renderer");
                    renderer = Platform.CreateRenderer(view, _renderer.View.Context);
                    Performance.Stop(reference, "New renderer");
                }

                if (renderer == oldRenderer)
                {
                    Platform.SetRenderer(renderer.Element, null);
                    renderer.SetElement(view);
                }

                Performance.Start(reference, "Set renderer");
                Platform.SetRenderer(view, renderer);
                Performance.Stop(reference, "Set renderer");

                Performance.Start(reference, "Add view");
                if (!sameChildren)
                {
                    (_renderer.View as ViewGroup)?.AddView(renderer.View);
                    _childViews.Add(renderer);
                }
                Performance.Stop(reference, "Add view");

                Performance.Stop(reference);
            }
        }
예제 #5
0
        public PopupRootLayout()
        {
            _shadowBorder = CreateShadowBorder();
            Children.Add(_shadowBorder);

            _border = CreateBorder();
            Children.Add(_border);

            // Create container for content
            _contentContainer = new Container();
            CompressedLayout.SetIsHeadless(_contentContainer, true);
            _border.Content = _contentContainer;
        }
        public void UpdateMarkerLayout()
        {
            var view           = Element;
            var _context       = Context;
            var headlessOffset = CompressedLayout.GetHeadlessOffset(view);
            var x      = (int)_context.ToPixels(view.X + headlessOffset.X);
            var y      = (int)_context.ToPixels(view.Y + headlessOffset.Y);
            var size   = view.Measure(double.PositiveInfinity, double.PositiveInfinity, MeasureFlags.IncludeMargins);
            var width  = Math.Max(0, (int)_context.ToPixels(size.Request.Width));
            var height = Math.Max(0, (int)_context.ToPixels(size.Request.Height));

            Measure(MeasureSpec.MakeMeasureSpec(width, Android.Views.MeasureSpecMode.Unspecified), MeasureSpec.MakeMeasureSpec(height, Android.Views.MeasureSpecMode.Unspecified));
            Layout(x, y, x + width, y + height);
        }
예제 #7
0
        public void UpdateLayout()
        {
            Performance.Start(out string reference);

            VisualElement view  = _renderer.Element;
            AView         aview = _renderer.View;

            var headlessOffset = CompressedLayout.GetHeadlessOffset(view);
            var x      = (int)_context.ToPixels(view.X + headlessOffset.X);
            var y      = (int)_context.ToPixels(view.Y + headlessOffset.Y);
            var width  = Math.Max(0, (int)_context.ToPixels(view.Width));
            var height = Math.Max(0, (int)_context.ToPixels(view.Height));


            if (aview is FormsViewGroup formsViewGroup)
            {
                Performance.Start(reference, "MeasureAndLayout");
                formsViewGroup.MeasureAndLayout(MeasureSpecFactory.MakeMeasureSpec(width, MeasureSpecMode.Exactly), MeasureSpecFactory.MakeMeasureSpec(height, MeasureSpecMode.Exactly), x, y, x + width, y + height);
                Performance.Stop(reference, "MeasureAndLayout");
            }
            else if (aview is LayoutViewGroup && width == 0 && height == 0)
            {
                // Nothing to do here; just chill.
            }
            else
            {
                Performance.Start(reference, "Measure");
                aview.Measure(MeasureSpecFactory.MakeMeasureSpec(width, MeasureSpecMode.Exactly), MeasureSpecFactory.MakeMeasureSpec(height, MeasureSpecMode.Exactly));
                Performance.Stop(reference, "Measure");

                Performance.Start(reference, "Layout");
                aview.Layout(x, y, x + width, y + height);
                Performance.Stop(reference, "Layout");
            }

            // If we're running sufficiently new Android, we have to make sure to update the ClipBounds to
            // match the new size of the ViewGroup
            if ((int)Forms.SdkInt >= 18)
            {
                UpdateClipToBounds();
            }

            UpdateClip();

            Performance.Stop(reference);

            //On Width or Height changes, the anchors needs to be updated
            UpdateAnchorX();
            UpdateAnchorY();
        }
예제 #8
0
        public static void CompressAllLayouts(this Layout <View> layout)
        {
            var childLayouts = GetChildLayouts(layout);

            foreach (var childLayout in childLayouts)
            {
                CompressAllLayouts(childLayout);
            }

            if (layout.BackgroundColor == default && !layout.GestureRecognizers.Any())
            {
                CompressedLayout.SetIsHeadless(layout, true);
            }
        }
예제 #9
0
        void AddChild(VisualElement view, IVisualElementRenderer oldRenderer = null, RendererPool pool = null, bool sameChildren = false)
        {
            Performance.Start();

            if (CompressedLayout.GetIsHeadless(view))
            {
                var packager = new VisualElementPackager(_renderer, view);
                view.IsPlatformEnabled = true;
                packager.Load();
            }
            else
            {
                if (_childViews == null)
                {
                    _childViews = new List <IVisualElementRenderer>();
                }

                IVisualElementRenderer renderer = oldRenderer;
                if (pool != null)
                {
                    renderer = pool.GetFreeRenderer(view);
                }
                if (renderer == null)
                {
                    Performance.Start("New renderer");
                    renderer = Platform.CreateRenderer(view);
                    Performance.Stop("New renderer");
                }

                if (renderer == oldRenderer)
                {
                    Platform.SetRenderer(renderer.Element, null);
                    renderer.SetElement(view);
                }

                Performance.Start("Set renderer");
                Platform.SetRenderer(view, renderer);
                Performance.Stop("Set renderer");

                Performance.Start("Add view");
                if (!sameChildren)
                {
                    (_renderer.View as ViewGroup)?.AddView(renderer.View);
                    _childViews.Add(renderer);
                }
                Performance.Stop("Add view");
            }
            Performance.Stop();
        }
예제 #10
0
        public void UpdateLayout()
        {
            var reference = Guid.NewGuid().ToString();

            Performance.Start(reference);

            VisualElement view  = _renderer.Element;
            AView         aview = _renderer.View;

            var headlessOffset = CompressedLayout.GetHeadlessOffset(view);
            var x      = (int)_context.ToPixels(view.X + headlessOffset.X);
            var y      = (int)_context.ToPixels(view.Y + headlessOffset.Y);
            var width  = Math.Max(0, (int)_context.ToPixels(view.Width));
            var height = Math.Max(0, (int)_context.ToPixels(view.Height));

            var formsViewGroup = aview as FormsViewGroup;

            if (formsViewGroup == null)
            {
                Performance.Start(reference, "Measure");
                aview.Measure(MeasureSpecFactory.MakeMeasureSpec(width, MeasureSpecMode.Exactly), MeasureSpecFactory.MakeMeasureSpec(height, MeasureSpecMode.Exactly));
                Performance.Stop(reference, "Measure");

                Performance.Start(reference, "Layout");
                aview.Layout(x, y, x + width, y + height);
                Performance.Stop(reference, "Layout");
            }
            else
            {
                Performance.Start(reference, "MeasureAndLayout");
                formsViewGroup.MeasureAndLayout(MeasureSpecFactory.MakeMeasureSpec(width, MeasureSpecMode.Exactly), MeasureSpecFactory.MakeMeasureSpec(height, MeasureSpecMode.Exactly), x, y, x + width, y + height);
                Performance.Stop(reference, "MeasureAndLayout");
            }

            // If we're running sufficiently new Android, we have to make sure to update the ClipBounds to
            // match the new size of the ViewGroup
            if ((int)Build.VERSION.SdkInt >= 18)
            {
                UpdateClipToBounds();
            }

            Performance.Stop(reference);

            //On Width or Height changes, the anchors needs to be updated
            UpdateAnchorX();
            UpdateAnchorY();
        }
예제 #11
0
        static double ComputeAbsoluteY(VisualElement e)
        {
            var parentY = 0.0;

            if (e.RealParent is VisualElement ve)
            {
                if (CompressedLayout.GetIsHeadless(e.RealParent))
                {
                    parentY = ComputeAbsoluteY(ve);
                }
                else
                {
                    parentY = Forms.ConvertToScaledDP(Platform.GetRenderer(e.RealParent).GetNativeContentGeometry().Y);
                }
            }
            return(e.Y + parentY);
        }
예제 #12
0
        public MechLab()
        {
            this.Title = "Main Menu";
            var scroll = new ScrollView();

            Content = scroll;
            StackLayout stackLayout = new StackLayout();

            Button button = new Button();

            button.Clicked += Button_Clicked;
            button.Text     = "Read MTF";
            stackLayout.Children.Add(button);
            CompressedLayout.SetIsHeadless(stackLayout, true);
            Content = new ScrollView {
                Content = stackLayout
            };
        }
예제 #13
0
        static void UpdateLayout(IEnumerable <Element> children)
        {
            foreach (Element element in children)
            {
                var visualElement = element as VisualElement;
                if (visualElement == null)
                {
                    continue;
                }

                IVisualElementRenderer renderer = AppCompat.Platform.GetRenderer(visualElement);
                if (renderer == null && CompressedLayout.GetIsHeadless(visualElement))
                {
                    UpdateLayout(visualElement.LogicalChildren);
                }

                renderer?.UpdateLayout();
            }
        }
예제 #14
0
 protected virtual void AddHeadlessChild(VisualElement element, IContainable <EvasObject> parent)
 {
     foreach (var child in (element as IVisualTreeElement).GetVisualChildren())
     {
         if (child is VisualElement visualChild)
         {
             if (CompressedLayout.GetIsHeadless(visualChild))
             {
                 AddHeadlessChild(visualChild, parent);
                 visualChild.IsPlatformEnabled = true;
             }
             else
             {
                 var childRenderer = Platform.GetOrCreateRenderer(visualChild);
                 parent.Children.Add(childRenderer.NativeView);
             }
         }
     }
 }
예제 #15
0
        public static void CompressLayoutAsHeadless(Layout layout, bool apply = true)
        {
            if (!apply)
            {
                return;
            }

            foreach (var child in layout.Children)
            {
                if (child is Layout currentLayout)
                {
                    CompressLayoutAsHeadless(currentLayout);
                }

                if (child is Layout currentLayoutHeadless)
                {
                    CompressedLayout.SetIsHeadless(child, apply);
                }
            }
        }
예제 #16
0
 /// <summary>
 /// Adds a new child if it's derived from the VisualElement class. Otherwise this method does nothing.
 /// </summary>
 /// <param name="child">Child to be added.</param>
 protected virtual void AddChild(Element child)
 {
     if (child is VisualElement ve)
     {
         if (CompressedLayout.GetIsHeadless(ve) && NativeView is IContainable <EvasObject> containerNativeView)
         {
             AddHeadlessChild(ve, containerNativeView);
             ve.IsPlatformEnabled = true;
         }
         else
         {
             var childRenderer = Platform.GetOrCreateRenderer(ve);
             // if the native view can have children, attach the new child
             if (NativeView is IContainable <EvasObject> containerView)
             {
                 containerView.Children.Add(childRenderer.NativeView);
             }
         }
     }
 }
예제 #17
0
 void FillChildrenWithRenderers(VisualElement element)
 {
     foreach (var logicalChild in ((IElementController)element).LogicalChildren)
     {
         var child = logicalChild as VisualElement;
         if (child != null)
         {
             if (CompressedLayout.GetIsHeadless(child))
             {
                 child.IsPlatformEnabled = true;
                 FillChildrenWithRenderers(child);
             }
             else
             {
                 var renderer = GetFreeRenderer(child) ?? Platform.CreateRenderer(child);
                 Platform.SetRenderer(child, renderer);
                 _parent.NativeView.AddSubview(renderer.NativeView);
             }
         }
     }
 }
예제 #18
0
        public void UpdateLayout()
        {
            var reference = Guid.NewGuid().ToString();

            Performance.Start(reference);

            VisualElement view  = _renderer.Element;
            AView         aview = _renderer.View;

            var headlessOffset = CompressedLayout.GetHeadlessOffset(view);
            var x      = (int)_context.ToPixels(view.X + headlessOffset.X);
            var y      = (int)_context.ToPixels(view.Y + headlessOffset.Y);
            var width  = Math.Max(0, (int)_context.ToPixels(view.Width));
            var height = Math.Max(0, (int)_context.ToPixels(view.Height));

            var formsViewGroup = aview as FormsViewGroup;

            if (formsViewGroup == null)
            {
                Performance.Start(reference, "Measure");
                aview.Measure(MeasureSpecFactory.MakeMeasureSpec(width, MeasureSpecMode.Exactly), MeasureSpecFactory.MakeMeasureSpec(height, MeasureSpecMode.Exactly));
                Performance.Stop(reference, "Measure");

                Performance.Start(reference, "Layout");
                aview.Layout(x, y, x + width, y + height);
                Performance.Stop(reference, "Layout");
            }
            else
            {
                Performance.Start(reference, "MeasureAndLayout");
                formsViewGroup.MeasureAndLayout(MeasureSpecFactory.MakeMeasureSpec(width, MeasureSpecMode.Exactly), MeasureSpecFactory.MakeMeasureSpec(height, MeasureSpecMode.Exactly), x, y, x + width, y + height);
                Performance.Stop(reference, "MeasureAndLayout");
            }

            Performance.Stop(reference);

            //On Width or Height changes, the anchors needs to be updated
            UpdateAnchorX();
            UpdateAnchorY();
        }
예제 #19
0
        static double ComputeAbsoluteY(VisualElement e)
        {
            var parentY = 0.0;

            if (e.RealParent is VisualElement parent)
            {
                if (CompressedLayout.GetIsHeadless(e.RealParent))
                {
                    parentY = ComputeAbsoluteY(parent);
                }
                else
                {
                    if (parent.Handler is IPlatformViewHandler nativeHandler)
                    {
                        parentY = nativeHandler.GetPlatformContentGeometry().Y.ToScaledDP();
                    }
                    else
                    {
                        parentY = Forms.ConvertToScaledDP(Platform.GetRenderer(e.RealParent).GetNativeContentGeometry().Y);
                    }
                }
            }
            return(e.Y + parentY);
        }
예제 #20
0
        void OnUpdateNativeControl(CALayer caLayer)
        {
            var view   = Renderer.Element;
            var uiview = Renderer.NativeView;

            if (view == null || view.Batched)
            {
                return;
            }

            bool shouldInteract;

            if (view is Layout layout)
            {
                if (layout.InputTransparent)
                {
                    shouldInteract = !layout.CascadeInputTransparent;
                }
                else
                {
                    shouldInteract = layout.IsEnabled;
                }
            }
            else
            {
                shouldInteract = !view.InputTransparent && view.IsEnabled;
            }

            if (_isInteractive != shouldInteract)
            {
#if __MOBILE__
                uiview.UserInteractionEnabled = shouldInteract;
#endif
                _isInteractive = shouldInteract;
            }

            var boundsChanged = _lastBounds != view.Bounds && TrackFrame;
#if !__MOBILE__
            var viewParent          = view.RealParent as VisualElement;
            var parentBoundsChanged = _lastParentBounds != (viewParent == null ? Rectangle.Zero : viewParent.Bounds);
#else
            var thread = !boundsChanged && !caLayer.Frame.IsEmpty && Application.Current?.OnThisPlatform()?.GetHandleControlUpdatesOnMainThread() == false;
#endif
            var anchorX      = (float)view.AnchorX;
            var anchorY      = (float)view.AnchorY;
            var translationX = (float)view.TranslationX;
            var translationY = (float)view.TranslationY;
            var rotationX    = (float)view.RotationX;
            var rotationY    = (float)view.RotationY;
            var rotation     = (float)view.Rotation;
            var scale        = (float)view.Scale;
            var scaleX       = (float)view.ScaleX * scale;
            var scaleY       = (float)view.ScaleY * scale;
            var width        = (float)view.Width;
            var height       = (float)view.Height;
            var x            = (float)view.X + (float)CompressedLayout.GetHeadlessOffset(view).X;
            var y            = (float)view.Y + (float)CompressedLayout.GetHeadlessOffset(view).Y;
            var opacity      = (float)view.Opacity;
            var isVisible    = view.IsVisible;

            var updateTarget = Interlocked.Increment(ref _updateCount);

            void update()
            {
                if (updateTarget != _updateCount)
                {
                    return;
                }
#if __MOBILE__
                var visualElement = view;
#endif
                var parent = view.RealParent;

                var shouldRelayoutSublayers = false;
                if (isVisible && caLayer.Hidden)
                {
#if !__MOBILE__
                    uiview.Hidden = false;
#endif
                    caLayer.Hidden = false;
                    if (!caLayer.Frame.IsEmpty)
                    {
                        shouldRelayoutSublayers = true;
                    }
                }

                if (!isVisible && !caLayer.Hidden)
                {
#if !__MOBILE__
                    uiview.Hidden = true;
#endif
                    caLayer.Hidden          = true;
                    shouldRelayoutSublayers = true;
                }

                // ripe for optimization
                var transform = CATransform3D.Identity;

#if __MOBILE__
                bool shouldUpdate = (!(visualElement is Page) || visualElement is ContentPage) && width > 0 && height > 0 && parent != null && boundsChanged;
#else
                // We don't care if it's a page or not since bounds of the window can change
                // TODO: Find why it doesn't work to check if the parentsBounds changed  and remove true;
                parentBoundsChanged = true;
                bool shouldUpdate = width > 0 && height > 0 && parent != null && (boundsChanged || parentBoundsChanged);
#endif
                // Dont ever attempt to actually change the layout of a Page unless it is a ContentPage
                // iOS is a really big fan of you not actually modifying the View's of the UIViewControllers
                if (shouldUpdate && TrackFrame)
                {
#if __MOBILE__
                    var target = new RectangleF(x, y, width, height);
#else
                    var   visualParent = parent as VisualElement;
                    float newY         = visualParent == null ? y : Math.Max(0, (float)(visualParent.Height - y - view.Height));
                    var   target       = new RectangleF(x, newY, width, height);
#endif

                    // must reset transform prior to setting frame...
                    caLayer.Transform = transform;
                    uiview.Frame      = target;
                    if (shouldRelayoutSublayers)
                    {
                        caLayer.LayoutSublayers();
                    }
                }
                else if (width <= 0 || height <= 0)
                {
                    //TODO: FInd why it doesn't work
#if __MOBILE__
                    caLayer.Hidden = true;
#endif
                    return;
                }
#if __MOBILE__
                caLayer.AnchorPoint = new PointF(anchorX, anchorY);
#else
                caLayer.AnchorPoint = new PointF(anchorX - 0.5f, anchorY - 0.5f);
#endif
                caLayer.Opacity = opacity;
                const double epsilon = 0.001;

                // position is relative to anchor point
                if (Math.Abs(anchorX - .5) > epsilon)
                {
                    transform = transform.Translate((anchorX - .5f) * width, 0, 0);
                }
                if (Math.Abs(anchorY - .5) > epsilon)
                {
                    transform = transform.Translate(0, (anchorY - .5f) * height, 0);
                }

                if (Math.Abs(translationX) > epsilon || Math.Abs(translationY) > epsilon)
                {
                    transform = transform.Translate(translationX, translationY, 0);
                }

                if (Math.Abs(scaleX - 1) > epsilon || Math.Abs(scaleY - 1) > epsilon)
                {
                    transform = transform.Scale(scaleX, scaleY, scale);
                }

                // not just an optimization, iOS will not "pixel align" a view which has m34 set
                if (Math.Abs(rotationY % 180) > epsilon || Math.Abs(rotationX % 180) > epsilon)
                {
                    transform.m34 = 1.0f / -400f;
                }

                if (Math.Abs(rotationX % 360) > epsilon)
                {
                    transform = transform.Rotate(rotationX * (float)Math.PI / 180.0f, 1.0f, 0.0f, 0.0f);
                }
                if (Math.Abs(rotationY % 360) > epsilon)
                {
                    transform = transform.Rotate(rotationY * (float)Math.PI / 180.0f, 0.0f, 1.0f, 0.0f);
                }

                transform = transform.Rotate(rotation * (float)Math.PI / 180.0f, 0.0f, 0.0f, 1.0f);

                if (Foundation.NSThread.IsMain)
                {
                    caLayer.Transform = transform;
                    return;
                }
                CoreFoundation.DispatchQueue.MainQueue.DispatchAsync(() =>
                {
                    caLayer.Transform = transform;
                });
            }

#if __MOBILE__
            if (thread)
            {
                CADisplayLinkTicker.Default.Invoke(update);
            }
            else
            {
                update();
            }
#else
            update();
#endif

            _lastBounds = view.Bounds;
#if !__MOBILE__
            _lastParentBounds = viewParent?.Bounds ?? Rectangle.Zero;
#endif
        }
예제 #21
0
        public MarketMainPage()
        {
            //#region NAVIGATION PAGE


            //NavigationPage.SetTitleView(this, new RoundedEntry
            //{
            //    FontSize = 13.5,
            //    Placeholder = "Buscar en Chappsy Market",
            //    HeightRequest = 30,
            //    HorizontalOptions = LayoutOptions.FillAndExpand,
            //});

            //#endregion

            #region CATEGORIES CAROUSEL

            Categories = new CollectionView
            {
                BackgroundColor = Color.White,
                SelectionMode   = SelectionMode.Single,
                Margin          = new Thickness(10, 0),
                HeightRequest   = 53,
                ItemsLayout     = ListItemsLayout.HorizontalList,
                ItemTemplate    = new CategoryTemplateSelector(),
                ItemsSource     = new List <CategoryModel>
                {
                    new CategoryModel
                    {
                        Name = "cube 1",
                        Icon = "cube.svg"
                    },
                    new CategoryModel
                    {
                        Name = "cube 1",
                        Icon = "cube.svg"
                    }
                }
            };
            #endregion

            #region PRODUCT TIMELINE
            Source = new ObservableCollection <ProductModel>
            {
                // Header
                new ProductModel
                {
                    Index = -1
                }
            };

            List <ProductModel> list = new List <ProductModel>();

            for (int i = 0; i < 25; i++)
            {
                list.Add(new ProductModel
                {
                    Index       = i,
                    Description = "Lorem ipsum dolor sit amet consectetur adipiscing elit phasellus mollis hac, accumsan interdum conubia suscipit per sollicitudin odio tristique id.",
                    Title       = "Lorem ipsum.",
                    Price       = "$10",
                    Pictures    = new List <string>
                    {
                        "http://i.dailymail.co.uk/i/pix/2015/09/01/18/2BE1E88B00000578-3218613-image-m-5_1441127035222.jpg"
                    }
                });
            }
            PopulateProductsLists(list);

            var collection = new CustomObject.ReciclerView.RecyclerView();

            collection.ScrollChange += Collection_ScrollChange;
            collection.ItemTapped   += Collection_ItemTapped;;
            collection.ItemsSource   = Source;

            #endregion


            //var ConectivityMessage = CreateConectivityMessage();
            //ConectivityMessage.SetBinding(View.IsVisibleProperty, nameof(MarketMainPageViewModel.IsConectivityDisable));

            var MainContainer = new Grid
            {
                Padding        = new Thickness(5, 0),
                RowDefinitions = new RowDefinitionCollection
                {
                    new RowDefinition
                    {
                        Height = new GridLength(1, GridUnitType.Star)
                    }
                }
            };

            MainContainer.Children.Add(collection, 0, 0);

            CompressedLayout.SetIsHeadless(MainContainer, true);


            #region MainContainer

            var Absolutelayout = new AbsoluteLayout();

            AbsoluteLayout.SetLayoutBounds(Categories, new Rectangle(0, 0, 1, AbsoluteLayout.AutoSize));
            AbsoluteLayout.SetLayoutFlags(Categories, AbsoluteLayoutFlags.WidthProportional);

            //AbsoluteLayout.SetLayoutBounds(ConectivityMessage, new Rectangle(.5, .6, 64 * 2, 64 * 2));
            //AbsoluteLayout.SetLayoutFlags(ConectivityMessage, AbsoluteLayoutFlags.PositionProportional);

            AbsoluteLayout.SetLayoutBounds(MainContainer, new Rectangle(0, 0, 1, 1));
            AbsoluteLayout.SetLayoutFlags(MainContainer, AbsoluteLayoutFlags.SizeProportional);

            Absolutelayout.Children.Add(MainContainer);
            //Absolutelayout.Children.Add(ConectivityMessage);
            Absolutelayout.Children.Add(Categories);

            #endregion

            Content = Absolutelayout;
        }
예제 #22
0
 public RepeaterView()
 {
     CompressedLayout.SetIsHeadless(this, true);
     Spacing = 0;
 }
예제 #23
0
        public FramesPageCS()
        {
            Title = "Frames";
            Icon  = "csharp.png";

            // SearchBar

            SearchBar searchBar = new SearchBar
            {
                Placeholder = "Enter your search here.",
            };

            searchBar.TextChanged += (sender, e) =>
            {
                return;
            };
            searchBar.SearchButtonPressed += (sender, e) =>
            {
                return;
            };

            // Filter Toolbar Item

            ToolbarItem toolbarItem = new ToolbarItem
            {
                Text    = "F",
                Command = ShowRoomsFilterPage,
            };

            this.ToolbarItems.Add(
                toolbarItem
                );

            this.SlideMenu = new RoomsFilterPage();

            // Rooms DataTemplate

            var roomsDataTemplate = new DataTemplate(() => {
                var grid = new Grid();
                CompressedLayout.SetIsHeadless(grid, true);

                grid.RowDefinitions.Add(new RowDefinition {
                    Height = 20
                });
                //grid.RowDefinitions.Add(new RowDefinition { Height = 700 });

                grid.RowSpacing    = 0;
                grid.ColumnSpacing = 10;

                grid.ColumnDefinitions.Add(new ColumnDefinition {
                    Width = new GridLength(0.5, GridUnitType.Star)
                });
                grid.ColumnDefinitions.Add(new ColumnDefinition {
                    Width = new GridLength(0.2, GridUnitType.Star)
                });
                grid.ColumnDefinitions.Add(new ColumnDefinition {
                    Width = new GridLength(0.3, GridUnitType.Star)
                });

                var indexLabel = new Label {
                    IsVisible = false
                };
                var nameLabel = new Label {
                    FontAttributes = FontAttributes.Bold
                };

                indexLabel.SetBinding(Label.TextProperty, "Index");
                nameLabel.SetBinding(Label.TextProperty, "Name");

                grid.Children.Add(indexLabel, 0, 1, 0, 1);
                grid.Children.Add(nameLabel, 0, 1, 0, 1);

                var timeSlotsLayout               = new TimeSlotsFrameLayout();
                timeSlotsLayout.Padding           = 20;
                timeSlotsLayout.WidthRequest      = 300;
                timeSlotsLayout.HorizontalOptions = LayoutOptions.Start;
                timeSlotsLayout.SetBinding(TimeSlotsFrameLayout.TimeSlotsSourceProperty, "TimeSlots");
                grid.Children.Add(timeSlotsLayout, 0, 3, 1, 2);

                return(new ViewCell
                {
                    View = grid
                });
            });

            // Rooms ListView

            listView = new ListView()
            {
                ItemsSource  = App.RoomsViewModel.Rooms,
                ItemTemplate = roomsDataTemplate,
                //RowHeight = 150,
                HasUnevenRows  = true,
                SeparatorColor = Color.Transparent,
            };
            listView.Margin = new Thickness(10);
            //listView.On<Platform::Android>().SetIsFastScrollEnabled(true);

            // Next Button

            Button nextButton = new Button
            {
                Text              = "Next",
                BindingContext    = App.RoomsViewModel,
                Command           = GoToRoomDetailPage,
                WidthRequest      = 60.0,
                HeightRequest     = 40.0,
                BorderWidth       = 1,
                BorderColor       = Color.Green,
                VerticalOptions   = LayoutOptions.Start,
                HorizontalOptions = LayoutOptions.Fill,
                FontAttributes    = FontAttributes.Bold,
                FontSize          = 11.0,
                BackgroundColor   = Color.Green,
                TextColor         = Color.White,
            };

            nextButton.SetBinding(Button.IsEnabledProperty, "EnableRoomDetailNextButton");

            nextButton.Triggers.Add(new Trigger(typeof(Button))
            {
                Property = Button.IsEnabledProperty,
                Value    = true,
                Setters  =
                {
                    new Setter
                    {
                        Property = Button.BackgroundColorProperty,
                        Value    = "Green"
                    }
                }
            });
            nextButton.Triggers.Add(new Trigger(typeof(Button))
            {
                Property = Button.IsEnabledProperty,
                Value    = false,
                Setters  =
                {
                    new Setter
                    {
                        Property = Button.BackgroundColorProperty,
                        Value    = "LightGray"
                    }
                }
            });

            var testLabel = new Label
            {
                Text      = "Yo, yo, Dude",
                TextColor = Color.Green,
                //BackgroundColor = Color.Transparent,
                FontSize                = 14.0,
                FontAttributes          = FontAttributes.Bold,
                HorizontalOptions       = LayoutOptions.Fill,
                VerticalOptions         = LayoutOptions.Center,
                VerticalTextAlignment   = TextAlignment.Center,
                HorizontalTextAlignment = TextAlignment.Center,
            };

            var testFrame = new TimeSlotFrame {
                Content       = testLabel,
                WidthRequest  = 60.0,
                HeightRequest = 40.0,
                //FontSize = 11.0,
                //BorderWidth = 1,
                //BorderColor = Color.Green,
                OutlineColor      = Color.Green,
                VerticalOptions   = LayoutOptions.Start,
                HorizontalOptions = LayoutOptions.Fill,
                //FontAttributes = FontAttributes.Bold,
                BackgroundColor = Color.White,
                //TextColor = Color.Green,
            };

            Content = new StackLayout
            {
                Padding      = new Thickness(0, 0, 0, 0),
                WidthRequest = 300,
                Children     =
                {
                    /*
                     * new Label {
                     *  Text = "Buttons List",
                     *  FontAttributes = FontAttributes.Bold,
                     *  HorizontalOptions = LayoutOptions.Center
                     * },
                     */
                    searchBar,
                    listView,
                    nextButton,
                }
            };
        }
예제 #24
0
        public FramesPageCS()
        {
            Title = "Frames";
            Icon  = "csharp.png";

            // Rooms DataTemplate

            var roomsDataTemplate = new DataTemplate(() => {
                var grid = new Grid();
                CompressedLayout.SetIsHeadless(grid, true);

                grid.RowDefinitions.Add(new RowDefinition {
                    Height = 20
                });

                grid.RowSpacing    = 0;
                grid.ColumnSpacing = 10;

                grid.ColumnDefinitions.Add(new ColumnDefinition {
                    Width = new GridLength(0.5, GridUnitType.Star)
                });
                grid.ColumnDefinitions.Add(new ColumnDefinition {
                    Width = new GridLength(0.2, GridUnitType.Star)
                });
                grid.ColumnDefinitions.Add(new ColumnDefinition {
                    Width = new GridLength(0.3, GridUnitType.Star)
                });

                var indexLabel = new Label {
                    IsVisible = false
                };
                var nameLabel = new Label {
                    FontAttributes = FontAttributes.Bold
                };

                indexLabel.SetBinding(Label.TextProperty, "Index");
                nameLabel.SetBinding(Label.TextProperty, "Name");

                grid.Children.Add(indexLabel, 0, 1, 0, 1);
                grid.Children.Add(nameLabel, 0, 1, 0, 1);

                var timeSlotsLayout               = new TimeSlotsWrapLayout();
                timeSlotsLayout.Padding           = 20;
                timeSlotsLayout.WidthRequest      = 300;
                timeSlotsLayout.HorizontalOptions = LayoutOptions.Start;
                timeSlotsLayout.SetBinding(TimeSlotsWrapLayout.TimeSlotsSourceProperty, "TimeSlots");
                grid.Children.Add(timeSlotsLayout, 0, 3, 1, 2);

                return(new ViewCell
                {
                    View = grid
                });
            });

            // Rooms ListView

            listView = new ListView()
            {
                ItemTemplate   = roomsDataTemplate,
                HasUnevenRows  = true,
                SeparatorColor = Color.Transparent,
            };
            listView.Margin = new Thickness(10);
            listView.SetBinding(ListView.ItemsSourceProperty, "Rooms", BindingMode.Default);

            // Add Button

            Button addButton = new Button
            {
                Text              = "Add TimeSlot",
                BindingContext    = App.RoomsViewModel,
                Command           = AddTimeSlot,
                WidthRequest      = 60.0,
                HeightRequest     = 40.0,
                BorderWidth       = 1,
                BorderColor       = Color.Green,
                VerticalOptions   = LayoutOptions.Start,
                HorizontalOptions = LayoutOptions.Fill,
                FontAttributes    = FontAttributes.Bold,
                FontSize          = 20.0,
                BackgroundColor   = Color.Green,
                TextColor         = Color.White,
            };

            Content = new StackLayout
            {
                Padding      = new Thickness(0, 0, 0, 0),
                WidthRequest = 300,
                Children     =
                {
                    listView,
                    addButton,
                }
            };

            BindingContext = App.RoomsViewModel;
        }
예제 #25
0
 /// <summary>
 /// Initializes a new instance of the <see cref="T:AiForms.Effects.FloatingView"/> class.
 /// </summary>
 public FloatingView()
 {
     CompressedLayout.SetIsHeadless(this, true);
 }
예제 #26
0
        public MainPage()
        {
            _vm = new MainPageViewModel();
            this.BindingContext = _vm;


            Button buttonStart = new Button {
                Text = "START SCANNING BEACONS"
            };

            buttonStart.SetBinding(Button.CommandProperty, "StartRangingCommand");
            buttonStart.SetBinding(Button.TextProperty, new Binding("IsStartedRanging", converter: new IsStartedRangingToTextConverter()));
            Label labelInfo = new Label()
            {
                HorizontalOptions = LayoutOptions.Center, Text = "Beacons oredered by RSSI"
            };

            Button buttonTransmit = new Button {
                Text = "START BEACON"
            };

            buttonTransmit.SetBinding(Button.CommandProperty, "StartTransmitting");
            buttonTransmit.SetBinding(Button.TextProperty, new Binding("IsTransmitting", converter: new IsTransmittingToTextConverter()));


            StackLayout slHeader = new StackLayout()
            {
                Children = { buttonTransmit, buttonStart, labelInfo, }
            };

            ListView lv = new ListView {
                HasUnevenRows = true, SeparatorColor = Color.Black, SeparatorVisibility = SeparatorVisibility.Default, Header = slHeader
            };

            lv.SetBinding(ListView.ItemsSourceProperty, "ReceivedBeacons");
            lv.SetBinding(ListView.ItemTemplateProperty, "ViewCellBeaconTemplate");

            StackLayout sl = new StackLayout
            {
                Children = { lv }
            };

            CompressedLayout.SetIsHeadless(sl, true);

            Content = sl;

            InvokeCommandAction icaOnAppearing = new InvokeCommandAction();

            icaOnAppearing.SetBinding(InvokeCommandAction.CommandProperty, "OnAppearingCommand");
            EventHandlerBehavior ehbOnAppearing = new EventHandlerBehavior()
            {
                EventName = "Appearing"
            };

            ehbOnAppearing.Actions.Add(icaOnAppearing);

            InvokeCommandAction icaOnDisappearing = new InvokeCommandAction();

            icaOnDisappearing.SetBinding(InvokeCommandAction.CommandProperty, "OnDisappearingCommand");
            EventHandlerBehavior ehbOnDisappearing = new EventHandlerBehavior()
            {
                EventName = "Disappearing"
            };

            ehbOnDisappearing.Actions.Add(icaOnDisappearing);

            this.Behaviors.Add(ehbOnAppearing);
            this.Behaviors.Add(ehbOnDisappearing);
        }
예제 #27
0
        public HomePage()
        {
            this.Title = "Main Menu";
            var scroll = new ScrollView();

            Content = scroll;
            StackLayout stackLayout = new StackLayout();

            Image img = new Image();

            img.Source        = "Company.jpg";
            img.HeightRequest = 120;
            img.WidthRequest  = 600;
            stackLayout.Children.Add(img);

            Label lbl = new Label();

            lbl.Text     = "Companies";
            lbl.FontSize = 40;
            lbl.HorizontalTextAlignment = TextAlignment.Center;
            lbl.TextColor = Color.White;
            stackLayout.Children.Add(lbl);

            Button button = new Button();

            button.Text     = "Add Company";
            button.Clicked += Button_Clicked;
            stackLayout.Children.Add(button);

            button          = new Button();
            button.Text     = "Manage Companies";
            button.Clicked += btn_Edit_Companies_Clicked;
            stackLayout.Children.Add(button);
            stackLayout.BackgroundColor = Color.Gray;

            /*
             * BoxView box = new BoxView();
             * box.Color = Color.Black;
             * box.WidthRequest = 100;
             * box.HeightRequest = 2;
             * stackLayout.Children.Add(box);
             *
             * img = new Image();
             * img.Source = "Lance.jpg";
             * img.HeightRequest = 120;
             * img.WidthRequest = 600;
             * stackLayout.Children.Add(img);
             *
             * lbl = new Label();
             * lbl.Text = "Lances";
             * lbl.FontSize = 40;
             * lbl.HorizontalTextAlignment = TextAlignment.Center;
             * lbl.TextColor = Color.White;
             * stackLayout.Children.Add(lbl);
             *
             * button = new Button();
             * button.Text = "Add Lance";
             * button.Clicked += btn_Add_Lance_Clicked;
             * stackLayout.Children.Add(button);
             * stackLayout.BackgroundColor = Color.Gray;
             *
             * button = new Button();
             * button.Text = "Manage Lances";
             * button.Clicked += btn_Edit_Lance_Clicked;
             * stackLayout.Children.Add(button);
             * stackLayout.BackgroundColor = Color.Gray;
             *
             * box = new BoxView();
             * box.Color = Color.Black;
             * box.WidthRequest = 100;
             * box.HeightRequest = 2;
             * stackLayout.Children.Add(box);
             *
             * img = new Image();
             * img.Source = "Pilots.jpg";
             * img.HeightRequest = 120;
             * img.WidthRequest = 600;
             * stackLayout.Children.Add(img);
             *
             * lbl = new Label();
             * lbl.Text = "Pilots";
             * lbl.FontSize = 40;
             * lbl.HorizontalTextAlignment = TextAlignment.Center;
             * lbl.TextColor = Color.White;
             * stackLayout.Children.Add(lbl);
             *
             * button = new Button();
             * button.Text = "Add Pilot";
             * button.Clicked += btn_Add_Pilot_Clicked;
             * stackLayout.Children.Add(button);
             * stackLayout.BackgroundColor = Color.Gray;
             *
             * button = new Button();
             * button.Text = "Manage Pilots";
             * button.Clicked += btn_Edit_Pilot_Clicked;
             * stackLayout.Children.Add(button);
             * stackLayout.BackgroundColor = Color.Gray;
             */

            BoxView box = new BoxView();

            box.Color         = Color.Black;
            box.WidthRequest  = 100;
            box.HeightRequest = 2;
            stackLayout.Children.Add(box);

            img               = new Image();
            img.Source        = "Dragon.png";
            img.HeightRequest = 120;
            img.WidthRequest  = 600;
            stackLayout.Children.Add(img);

            lbl          = new Label();
            lbl.Text     = "Mech Lab";
            lbl.FontSize = 40;
            lbl.HorizontalTextAlignment = TextAlignment.Center;
            lbl.TextColor = Color.White;
            stackLayout.Children.Add(lbl);

            button          = new Button();
            button.Text     = "Edit Mechs";
            button.Clicked += btn_ML_Clicked;
            stackLayout.Children.Add(button);
            stackLayout.BackgroundColor = Color.Gray;



            box               = new BoxView();
            box.Color         = Color.Black;
            box.WidthRequest  = 100;
            box.HeightRequest = 2;
            stackLayout.Children.Add(box);

            img               = new Image();
            img.Source        = "BlankArmor.png";
            img.HeightRequest = 120;
            img.WidthRequest  = 600;
            stackLayout.Children.Add(img);

            lbl          = new Label();
            lbl.Text     = "Record Sheets";
            lbl.FontSize = 40;
            lbl.HorizontalTextAlignment = TextAlignment.Center;
            lbl.TextColor = Color.White;
            stackLayout.Children.Add(lbl);

            button          = new Button();
            button.Text     = "Record Sheet";
            button.Clicked += btn_RS_Clicked;
            stackLayout.Children.Add(button);
            stackLayout.BackgroundColor = Color.Gray;

            CompressedLayout.SetIsHeadless(stackLayout, true);
            Content = new ScrollView {
                Content = stackLayout
            };
        }
예제 #28
0
        public RecordSheetGeneral()
        {
            var            db     = new SQLiteConnection(_dbPath);
            AbsoluteLayout Layer1 = new AbsoluteLayout();

            Layer1.BackgroundColor = Color.Gray;

            _mechModel                         = new Label();
            _mechModel.Text                    = "CMD-1B Commando";
            _mechModel.FontSize                = 26;
            _mechModel.FontAttributes          = FontAttributes.Bold;
            _mechModel.TextColor               = Color.DarkGray;
            _mechModel.HorizontalTextAlignment = TextAlignment.Center;
            AbsoluteLayout.SetLayoutBounds(_mechModel, new Rectangle(0.5, 140, 1, 40));
            AbsoluteLayout.SetLayoutFlags(_mechModel, AbsoluteLayoutFlags.XProportional);
            AbsoluteLayout.SetLayoutFlags(_mechModel, AbsoluteLayoutFlags.WidthProportional);
            Layer1.Children.Add(_mechModel);

            _mechName                 = new Entry();
            _mechName.TextChanged    += Txt_TextChanged;
            _mechName.Text            = "Commando";
            _mechName.TextColor       = Color.White;
            _mechName.BackgroundColor = Color.Gray;
            AbsoluteLayout.SetLayoutBounds(_mechName, new Rectangle(0.5, 180, 1, 50));
            AbsoluteLayout.SetLayoutFlags(_mechName, AbsoluteLayoutFlags.XProportional);
            AbsoluteLayout.SetLayoutFlags(_mechName, AbsoluteLayoutFlags.WidthProportional);
            Layer1.Children.Add(_mechName);

            _mechImage = new Image();
            AbsoluteLayout.SetLayoutBounds(_mechImage, new Rectangle(0.5, 0, 120, 120));
            AbsoluteLayout.SetLayoutFlags(_mechImage, AbsoluteLayoutFlags.PositionProportional);
            Layer1.Children.Add(_mechImage);

            AbsoluteLayout Layer2 = new AbsoluteLayout();

            Layer2.BackgroundColor = Color.DarkGray;
            AbsoluteLayout.SetLayoutBounds(Layer2, new Rectangle(0, 220, 1, 50));
            AbsoluteLayout.SetLayoutFlags(Layer2, AbsoluteLayoutFlags.WidthProportional);

            AbsoluteLayout Layer31 = new AbsoluteLayout();

            Layer31.BackgroundColor = Color.White;
            AbsoluteLayout.SetLayoutBounds(Layer31, new Rectangle(0.5, 0, 130, 50));
            AbsoluteLayout.SetLayoutFlags(Layer31, AbsoluteLayoutFlags.XProportional);
            AbsoluteLayout.SetLayoutFlags(Layer31, AbsoluteLayoutFlags.YProportional);

            _walkButton = new Button();
            _walkButton.BackgroundColor = Color.Green;
            _walkButton.Pressed        += Btn_Walk_Pressed;
            _walkButton.CornerRadius    = 20;
            AbsoluteLayout.SetLayoutBounds(_walkButton, new Rectangle(5, 0.5, 40, 40));
            AbsoluteLayout.SetLayoutFlags(_walkButton, AbsoluteLayoutFlags.YProportional);
            Layer31.Children.Add(_walkButton);

            _walkLabel                = new Label();
            _walkLabel.Text           = "Walk 8";
            _walkLabel.FontSize       = 26;
            _walkLabel.FontAttributes = FontAttributes.Bold;
            _walkLabel.TextColor      = Color.Black;
            AbsoluteLayout.SetLayoutBounds(_walkLabel, new Rectangle(50, 1, 1, 50));
            AbsoluteLayout.SetLayoutFlags(_walkLabel, AbsoluteLayoutFlags.YProportional);
            AbsoluteLayout.SetLayoutFlags(_walkLabel, AbsoluteLayoutFlags.WidthProportional);
            Layer31.Children.Add(_walkLabel);
            Layer2.Children.Add(Layer31);

            AbsoluteLayout Layer32 = new AbsoluteLayout();

            Layer32.BackgroundColor = Color.White;
            AbsoluteLayout.SetLayoutBounds(Layer32, new Rectangle(0.5, 0, 130, 50));
            AbsoluteLayout.SetLayoutFlags(Layer32, AbsoluteLayoutFlags.PositionProportional);
            //AbsoluteLayout.SetLayoutFlags(Layer32, AbsoluteLayoutFlags.YProportional);

            _runButton = new Button();
            _runButton.BackgroundColor = Color.Red;
            _runButton.Pressed        += Btn_Run_Pressed;
            _runButton.CornerRadius    = 20;
            AbsoluteLayout.SetLayoutBounds(_runButton, new Rectangle(5, 0.5, 40, 40));
            AbsoluteLayout.SetLayoutFlags(_runButton, AbsoluteLayoutFlags.YProportional);
            Layer32.Children.Add(_runButton);

            _runLabel                = new Label();
            _runLabel.Text           = "Run 12";
            _runLabel.FontSize       = 26;
            _runLabel.FontAttributes = FontAttributes.Bold;
            _runLabel.TextColor      = Color.Black;
            AbsoluteLayout.SetLayoutBounds(_runLabel, new Rectangle(50, 1, 1, 50));
            AbsoluteLayout.SetLayoutFlags(_runLabel, AbsoluteLayoutFlags.YProportional);
            AbsoluteLayout.SetLayoutFlags(_runLabel, AbsoluteLayoutFlags.WidthProportional);
            Layer32.Children.Add(_runLabel);
            Layer2.Children.Add(Layer32);

            AbsoluteLayout Layer33 = new AbsoluteLayout();

            Layer33.BackgroundColor = Color.White;
            AbsoluteLayout.SetLayoutBounds(Layer33, new Rectangle(1, 0, 130, 50));
            AbsoluteLayout.SetLayoutFlags(Layer33, AbsoluteLayoutFlags.PositionProportional);
            //AbsoluteLayout.SetLayoutFlags(Layer33, AbsoluteLayoutFlags.YProportional);

            _jumpButton = new Button();
            _jumpButton.BackgroundColor = Color.LightBlue;
            _jumpButton.Pressed        += Btn_Jump_Pressed;
            _jumpButton.CornerRadius    = 20;
            AbsoluteLayout.SetLayoutBounds(_jumpButton, new Rectangle(5, 0.5, 40, 40));
            AbsoluteLayout.SetLayoutFlags(_jumpButton, AbsoluteLayoutFlags.YProportional);
            Layer33.Children.Add(_jumpButton);

            _jumpLabel                = new Label();
            _jumpLabel.Text           = "Jump 8";
            _jumpLabel.FontSize       = 26;
            _jumpLabel.FontAttributes = FontAttributes.Bold;
            _jumpLabel.TextColor      = Color.Black;
            AbsoluteLayout.SetLayoutBounds(_jumpLabel, new Rectangle(50, 1, 1, 50));
            AbsoluteLayout.SetLayoutFlags(_jumpLabel, AbsoluteLayoutFlags.YProportional);
            AbsoluteLayout.SetLayoutFlags(_jumpLabel, AbsoluteLayoutFlags.WidthProportional);
            Layer33.Children.Add(_jumpLabel);
            Layer2.Children.Add(Layer33);

            Layer1.Children.Add(Layer2);


            AbsoluteLayout Layer3 = new AbsoluteLayout();

            Layer3.BackgroundColor = Color.Transparent;;
            AbsoluteLayout.SetLayoutBounds(Layer3, new Rectangle(0, 270, AbsoluteLayout.AutoSize, AbsoluteLayout.AutoSize));
            // AbsoluteLayout.SetLayoutFlags(Layer3, AbsoluteLayoutFlags.WidthProportional);

            Label lbl = new Label();

            lbl.Text      = "Tonnage:";
            lbl.TextColor = Color.White;
            lbl.FontSize  = 15;
            AbsoluteLayout.SetLayoutBounds(lbl, new Rectangle(0, 25, 0.25, 50));
            AbsoluteLayout.SetLayoutFlags(lbl, AbsoluteLayoutFlags.WidthProportional);
            Layer3.Children.Add(lbl);

            _tonnageEntry                 = new Entry();
            _tonnageEntry.Text            = "50";
            _tonnageEntry.TextColor       = Color.White;
            _tonnageEntry.BackgroundColor = Color.Gray;
            _tonnageEntry.Keyboard        = Keyboard.Numeric;
            AbsoluteLayout.SetLayoutBounds(_tonnageEntry, new Rectangle(130, 0, 0.75, 50));
            AbsoluteLayout.SetLayoutFlags(_tonnageEntry, AbsoluteLayoutFlags.WidthProportional);
            Layer3.Children.Add(_tonnageEntry);

            Layer1.Children.Add(Layer3);

            AbsoluteLayout Layer4 = new AbsoluteLayout();

            Layer4.BackgroundColor = Color.Transparent;
            AbsoluteLayout.SetLayoutBounds(Layer4, new Rectangle(0, 330, 1, 50));
            AbsoluteLayout.SetLayoutFlags(Layer4, AbsoluteLayoutFlags.WidthProportional);

            lbl           = new Label();
            lbl.Text      = "Heat Sinks ";
            lbl.TextColor = Color.White;
            lbl.FontSize  = 15;
            AbsoluteLayout.SetLayoutBounds(lbl, new Rectangle(0, 25, 1, 50));
            AbsoluteLayout.SetLayoutFlags(lbl, AbsoluteLayoutFlags.WidthProportional);
            Layer4.Children.Add(lbl);

            _heatSinksEntry                 = new Entry();
            _heatSinksEntry.TextColor       = Color.White;
            _heatSinksEntry.BackgroundColor = Color.Gray;
            _heatSinksEntry.Keyboard        = Keyboard.Numeric;
            AbsoluteLayout.SetLayoutBounds(_heatSinksEntry, new Rectangle(75, 0, 0.25, 50));
            AbsoluteLayout.SetLayoutFlags(_heatSinksEntry, AbsoluteLayoutFlags.WidthProportional);
            Layer4.Children.Add(_heatSinksEntry);

            _heatSinksStepper               = new Stepper();
            _heatSinksStepper.Minimum       = 0;
            _heatSinksStepper.Maximum       = 13;
            _heatSinksStepper.Increment     = 1;
            _heatSinksStepper.ValueChanged += _heatSinksStepper_ValueChanged;
            AbsoluteLayout.SetLayoutBounds(_heatSinksStepper, new Rectangle(200, 0, 0.75, 50));
            AbsoluteLayout.SetLayoutFlags(_heatSinksStepper, AbsoluteLayoutFlags.WidthProportional);
            Layer4.Children.Add(_heatSinksStepper);
            Layer1.Children.Add(Layer4);

            AbsoluteLayout Layer5 = new AbsoluteLayout();

            Layer5.BackgroundColor = Color.Transparent;;
            AbsoluteLayout.SetLayoutBounds(Layer5, new Rectangle(0, 380, AbsoluteLayout.AutoSize, AbsoluteLayout.AutoSize));
            //AbsoluteLayout.SetLayoutFlags(Layer5, AbsoluteLayoutFlags.WidthProportional);

            lbl           = new Label();
            lbl.Text      = "Pilot:";
            lbl.TextColor = Color.White;
            lbl.FontSize  = 15;
            AbsoluteLayout.SetLayoutBounds(lbl, new Rectangle(0, 25, 0.25, 50));
            AbsoluteLayout.SetLayoutFlags(lbl, AbsoluteLayoutFlags.WidthProportional);
            Layer5.Children.Add(lbl);

            _pilotEntry                 = new Entry();
            _pilotEntry.Text            = "50";
            _pilotEntry.TextColor       = Color.White;
            _pilotEntry.BackgroundColor = Color.Gray;
            _pilotEntry.Keyboard        = Keyboard.Numeric;
            AbsoluteLayout.SetLayoutBounds(_pilotEntry, new Rectangle(130, 0, 0.75, 50));
            AbsoluteLayout.SetLayoutFlags(_pilotEntry, AbsoluteLayoutFlags.WidthProportional);
            Layer5.Children.Add(_pilotEntry);

            Layer1.Children.Add(Layer5);


            AbsoluteLayout Layer7 = new AbsoluteLayout();

            Layer7.BackgroundColor = Color.Transparent;;
            AbsoluteLayout.SetLayoutBounds(Layer7, new Rectangle(0, 430, AbsoluteLayout.AutoSize, AbsoluteLayout.AutoSize));
            //AbsoluteLayout.SetLayoutFlags(Layer7, AbsoluteLayoutFlags.WidthProportional);

            lbl           = new Label();
            lbl.Text      = "Piloting Skill:";
            lbl.TextColor = Color.White;
            lbl.FontSize  = 15;
            AbsoluteLayout.SetLayoutBounds(lbl, new Rectangle(0, 25, 0.25, 50));
            AbsoluteLayout.SetLayoutFlags(lbl, AbsoluteLayoutFlags.WidthProportional);
            Layer7.Children.Add(lbl);

            _pilotingSkill                 = new Entry();
            _pilotingSkill.Text            = "4";
            _pilotingSkill.TextColor       = Color.White;
            _pilotingSkill.BackgroundColor = Color.Gray;
            _pilotingSkill.Keyboard        = Keyboard.Numeric;
            AbsoluteLayout.SetLayoutBounds(_pilotingSkill, new Rectangle(130, 0, 0.75, 50));
            AbsoluteLayout.SetLayoutFlags(_pilotingSkill, AbsoluteLayoutFlags.WidthProportional);
            Layer7.Children.Add(_pilotingSkill);

            Layer1.Children.Add(Layer7);

            AbsoluteLayout Layer8 = new AbsoluteLayout();

            Layer8.BackgroundColor = Color.Transparent;;
            AbsoluteLayout.SetLayoutBounds(Layer8, new Rectangle(0, 480, AbsoluteLayout.AutoSize, AbsoluteLayout.AutoSize));
            //AbsoluteLayout.SetLayoutFlags(Layer8, AbsoluteLayoutFlags.WidthProportional);

            lbl           = new Label();
            lbl.Text      = "Gunnery Skill:";
            lbl.TextColor = Color.White;
            lbl.FontSize  = 15;
            AbsoluteLayout.SetLayoutBounds(lbl, new Rectangle(0, 25, 0.25, 50));
            AbsoluteLayout.SetLayoutFlags(lbl, AbsoluteLayoutFlags.WidthProportional);
            Layer8.Children.Add(lbl);

            _gunnerySkill                 = new Entry();
            _gunnerySkill.Text            = "4";
            _gunnerySkill.TextColor       = Color.White;
            _gunnerySkill.BackgroundColor = Color.Gray;
            _gunnerySkill.Keyboard        = Keyboard.Numeric;
            AbsoluteLayout.SetLayoutBounds(_gunnerySkill, new Rectangle(130, 0, 0.75, 50));
            AbsoluteLayout.SetLayoutFlags(_gunnerySkill, AbsoluteLayoutFlags.WidthProportional);
            Layer8.Children.Add(_gunnerySkill);

            Layer1.Children.Add(Layer8);



            AbsoluteLayout Layer9 = new AbsoluteLayout();

            Layer9.BackgroundColor = Color.Transparent;
            AbsoluteLayout.SetLayoutBounds(Layer9, new Rectangle(0, 530, 1, 50));
            AbsoluteLayout.SetLayoutFlags(Layer9, AbsoluteLayoutFlags.WidthProportional);

            lbl           = new Label();
            lbl.Text      = "Hits: ";
            lbl.TextColor = Color.White;
            lbl.FontSize  = 15;
            AbsoluteLayout.SetLayoutBounds(lbl, new Rectangle(0, 25, 1, 50));
            AbsoluteLayout.SetLayoutFlags(lbl, AbsoluteLayoutFlags.WidthProportional);
            Layer9.Children.Add(lbl);

            _hitsEntry                 = new Entry();
            _hitsEntry.TextColor       = Color.White;
            _hitsEntry.BackgroundColor = Color.Gray;
            _hitsEntry.Keyboard        = Keyboard.Numeric;
            AbsoluteLayout.SetLayoutBounds(_hitsEntry, new Rectangle(75, 0, 0.25, 50));
            AbsoluteLayout.SetLayoutFlags(_hitsEntry, AbsoluteLayoutFlags.WidthProportional);
            Layer9.Children.Add(_hitsEntry);

            _hitsStepper               = new Stepper();
            _hitsStepper.Minimum       = 0;
            _hitsStepper.Maximum       = 6;
            _hitsStepper.Increment     = 1;
            _hitsStepper.ValueChanged += _hitsStepper_ValueChanged;
            AbsoluteLayout.SetLayoutBounds(_hitsStepper, new Rectangle(200, 0, 0.75, 50));
            AbsoluteLayout.SetLayoutFlags(_hitsStepper, AbsoluteLayoutFlags.WidthProportional);
            Layer9.Children.Add(_hitsStepper);
            Layer1.Children.Add(Layer9);



            AbsoluteLayout Layer10 = new AbsoluteLayout();

            Layer10.BackgroundColor = Color.Transparent;;
            AbsoluteLayout.SetLayoutBounds(Layer10, new Rectangle(0, 580, AbsoluteLayout.AutoSize, AbsoluteLayout.AutoSize));


//            AbsoluteLayout.SetLayoutFlags(Layer10, AbsoluteLayoutFlags.WidthProportional);

            lbl           = new Label();
            lbl.Text      = "Consciousness:";
            lbl.TextColor = Color.White;
            lbl.FontSize  = 15;
            AbsoluteLayout.SetLayoutBounds(lbl, new Rectangle(0, 25, 0.25, 50));
            AbsoluteLayout.SetLayoutFlags(lbl, AbsoluteLayoutFlags.WidthProportional);
            Layer10.Children.Add(lbl);

            _consciousnessEntry                 = new Entry();
            _consciousnessEntry.Text            = "0";
            _consciousnessEntry.TextColor       = Color.White;
            _consciousnessEntry.BackgroundColor = Color.Gray;
            _consciousnessEntry.Keyboard        = Keyboard.Numeric;
            AbsoluteLayout.SetLayoutBounds(_consciousnessEntry, new Rectangle(130, 0, 0.75, 50));
            AbsoluteLayout.SetLayoutFlags(_consciousnessEntry, AbsoluteLayoutFlags.WidthProportional);
            Layer10.Children.Add(_consciousnessEntry);

            Layer1.Children.Add(Layer10);



            //TODO: Agregar seccion para Weapons
            AbsoluteLayout Layer11 = new AbsoluteLayout();

            Layer11.BackgroundColor = Color.Transparent;;
            AbsoluteLayout.SetLayoutBounds(Layer11, new Rectangle(0, 630, AbsoluteLayout.AutoSize, AbsoluteLayout.AutoSize));


            _listWeapons = new ListView();

            var template = new DataTemplate(typeof(TextCell));

            template.SetBinding(TextCell.TextProperty, "Name");
            template.SetValue(TextCell.TextColorProperty, Color.Gray);
            template.SetBinding(TextCell.DetailProperty, "CurrentAffiliation");

            _listWeapons.ItemTemplate = template;
            //_listWeapons.ItemsSource = db.Table<Weapon>().OrderBy(x => x.Name).ToList();

            _listWeapons.ItemSelected          += _listView_ItemSelected;
            _listWeapons.Refreshing            += _listView_Refreshing;
            _listWeapons.SeparatorColor         = Color.White;
            _listWeapons.IsPullToRefreshEnabled = true;

            Layer11.Children.Add(_listWeapons);


            Layer1.Children.Add(Layer11);
            //  Lista para mostrar las armas equipadas
            //  Agregar logica para disparar armas con sonido
            //  Agregar logica para almacenar el Heat generado

            //TODO: Agregar seccion para Heat
            //  Agregar contador para Heat
            //  Agregar logica para calcular Heat restante al restar los HeatSinks
            //  Agregar progress bar para mostrar Heat Actual

            //TODO: Agregar seccion para mostrar modificadores
            //  Agregar Lista para mostrar los modificadores activos despues de calculo de Heat
            //  Agregar logica para obtener modificadores causados por daño recibido



            CompressedLayout.SetIsHeadless(Layer1, true);
            Content = new ScrollView {
                Content = Layer1
            };
        }
        public CustomViewCellFavPage(Result result)
        {
            HeightRequest = 350;
            Direction = FlexDirection.Column;
            Margin = 16;
            AlignContent = FlexAlignContent.Center;

            Container = new Lazy<StackLayout>(() => new StackLayout()
            {
                Margin = 16,
                HorizontalOptions = LayoutOptions.Center,
                VerticalOptions = LayoutOptions.FillAndExpand
            });

            SubContainer = new Lazy<StackLayout>(() => new StackLayout()
            {
                Margin = new Thickness(16, 0, 16, 0),
                HeightRequest = 280,
                BackgroundColor = Color.FromHex("#44312D2D"),
                HorizontalOptions = LayoutOptions.FillAndExpand,
                VerticalOptions = LayoutOptions.FillAndExpand
            });

            absoluteLayout = new Lazy<AbsoluteLayout>(() => new AbsoluteLayout()
            {
                VerticalOptions = LayoutOptions.FillAndExpand
            });

            var BackdropPathSource = new UriImageSource()
            {
                CachingEnabled = true,
                CacheValidity = TimeSpan.MaxValue
            };
            BackdropPathSource.SetBinding(UriImageSource.UriProperty, new Binding("BackdropPath", BindingMode.Default, new BackgroundImageUrlConverter()));

            //blurCachedImage = new Lazy<CachedImage>(() => new CachedImage()
            //{
            //    HeightRequest = 300,
            //    WidthRequest = 300,
            //    Opacity = 60,
            //    Source = BackdropPathSource,
            //    Transformations = Transformations,
            //    HorizontalOptions = LayoutOptions.FillAndExpand,
            //    Scale = 3,
            //    VerticalOptions = LayoutOptions.FillAndExpand
            //});
            blurCachedImage = new Lazy<Image>(() => new Image()
            {
                HeightRequest = 300,
                WidthRequest = 300,
                Opacity = 60,
                Source = BackdropPathSource,
                Scale = 3
            });

            var PosterPathSource = new UriImageSource()
            {
                CachingEnabled = true,
                CacheValidity = TimeSpan.MaxValue
            };
            PosterPathSource.SetBinding(UriImageSource.UriProperty, new Binding("PosterPath", BindingMode.Default, new PosterImageUrlConverter()));

            cachedImage = new Lazy<Image>(() => new Image()
            {
                Aspect = Aspect.AspectFill,
                Source = PosterPathSource
            });

            FrameCover = new Lazy<Frame>(() => new Frame()
            {
                IsClippedToBounds = true,
                Margin = new Thickness(0, 0, 0, 0),
                HasShadow = true,
                BorderColor = Color.FromHex("#00000000"),
                Padding = new Thickness(0, 0, 0, 0),
                BackgroundColor = Color.FromHex("#00000000"),
                CornerRadius = 15
            });

            panelContainer = new Lazy<StackLayout>(() => new StackLayout()
            {
                HeightRequest = 125,
                HorizontalOptions = LayoutOptions.Center,
            });

            FrameUnderImages = new Lazy<Frame>(() => new Frame()
            {
                BackgroundColor = Color.FromHex("#44312D2D"),
                CornerRadius = 5,
                HasShadow = true,
                HorizontalOptions = LayoutOptions.Center
            });

            ColumnDefinitionCollection columnDefinitions = new ColumnDefinitionCollection()
            {
                new ColumnDefinition() { Width = new GridLength(1, GridUnitType.Star)},
                new ColumnDefinition() { Width = GridLength.Star},
                new ColumnDefinition() { Width = GridLength.Star}
            };

            RowDefinitionCollection rowDefinitions = new RowDefinitionCollection()
            {
                new RowDefinition() { Height = GridLength.Star},
                new RowDefinition() { Height = GridLength.Star}
            };

            gridInsideFrame = new Lazy<Grid>(() => new Grid()
            {
                ColumnDefinitions = columnDefinitions,
                RowDefinitions = rowDefinitions
            });

            title = new Lazy<Label>(() => new Label()
            {
                FontSize = Device.GetNamedSize(NamedSize.Medium, typeof(Label)),
                TextColor = Color.White,
                LineBreakMode = LineBreakMode.TailTruncation,
                Margin = new Thickness(16, 0, 0, 0),
                FontFamily = "Arial",
                FontAttributes = FontAttributes.Bold
            });

            title.Value.SetBinding(Label.TextProperty, "Title");

            releaseDate = new Lazy<Label>(() => new Label()
            {
                FontSize = Device.GetNamedSize(NamedSize.Small, typeof(Label)),
                TextColor = Color.FromHex("#65FFFFFF"),
                LineBreakMode = LineBreakMode.NoWrap,
                Margin = new Thickness(16, 0, 0, 0),
                FontFamily = "Arial",
                FontAttributes = FontAttributes.Bold
            });
            releaseDate.Value.SetBinding(Label.TextProperty, "ReleaseDate");

            compat = new Lazy<StackLayout>(() => new StackLayout()
            {
                HeightRequest = 50
            });

            unPinFromFavList = new Lazy<Image>(() => new Image()
            {
                HeightRequest = 40,
                WidthRequest = 40
            });
            unPinFromFavList.Value.SetBinding(Image.SourceProperty, "FavoriteMovie");

            FrameCover.Value.Content = cachedImage.Value;

            compat.Value.Children.Add(unPinFromFavList.Value);

            gridInsideFrame.Value.Children.Add(title.Value, 0, 0);
            Grid.SetColumnSpan(title.Value, 3);
            gridInsideFrame.Value.Children.Add(releaseDate.Value, 0, 1);
            gridInsideFrame.Value.Children.Add(compat.Value, 2, 1);

            AbsoluteLayout.SetLayoutBounds(blurCachedImage.Value, new Rectangle(.5, 0, 1, 1));
            AbsoluteLayout.SetLayoutFlags(blurCachedImage.Value, AbsoluteLayoutFlags.All);
            AbsoluteLayout.SetLayoutBounds(FrameCover.Value, new Rectangle(.5, 0, 0.46, 1));
            AbsoluteLayout.SetLayoutFlags(FrameCover.Value, AbsoluteLayoutFlags.All);

            FrameUnderImages.Value.Content = gridInsideFrame.Value;

            absoluteLayout.Value.Children.Add(blurCachedImage.Value);
            absoluteLayout.Value.Children.Add(FrameCover.Value);
            CompressedLayout.SetIsHeadless(absoluteLayout.Value, true);

            panelContainer.Value.Children.Add(FrameUnderImages.Value);

            SubContainer.Value.Children.Add(absoluteLayout.Value);
            CompressedLayout.SetIsHeadless(SubContainer.Value, true);
            Container.Value.Children.Add(SubContainer.Value);
            Container.Value.Children.Add(panelContainer.Value);

            Children.Add(Container.Value);

            tap = new TapGestureRecognizer();

            tap.Tapped += QuitFromFavListTap;

            compat.Value.GestureRecognizers.Add(tap);

            Result = result;

            var OnTapNavigationGesture = new TapGestureRecognizer();
            OnTapNavigationGesture.Tapped += OnTapNavigationGesture_Tapped;

            GestureRecognizers.Add(OnTapNavigationGesture);
        }
예제 #30
0
        public CustomViewCell(Result result)
        {
            try
            {
                Result = result;

                CompressedLayout.SetIsHeadless(this, true);
                HeightRequest = 350;
                Direction     = FlexDirection.Column;
                Margin        = 16;
                AlignContent  = FlexAlignContent.Center;

                Container = new Lazy <StackLayout>(() => new StackLayout()
                {
                    Margin = 8
                });
                CompressedLayout.SetIsHeadless(Container.Value, true);

                SubContainer = new Lazy <StackLayout>(() => new StackLayout()
                {
                    Margin          = new Thickness(0, 0, 0, 0),
                    BackgroundColor = Color.Black
                });

                absoluteLayout = new Lazy <AbsoluteLayout>(() => new AbsoluteLayout()
                {
                });
                CompressedLayout.SetIsHeadless(absoluteLayout.Value, true);

                var uriToImgSource = new UriImageSource
                {
                    CacheValidity  = TimeSpan.FromDays(15),
                    CachingEnabled = true
                };

                cachedImage = new Lazy <CachedImage>(() => new CachedImage()
                {
                    Aspect               = Aspect.Fill,
                    CacheDuration        = TimeSpan.MaxValue,
                    LoadingPriority      = FFImageLoading.Work.LoadingPriority.Highest,
                    LoadingPlaceholder   = "Loading.png",
                    RetryCount           = 2,
                    RetryDelay           = 15,
                    DownsampleToViewSize = true,
                    Source               = new UriImageSource
                    {
                        CacheValidity  = TimeSpan.MaxValue,
                        CachingEnabled = true,
                        Uri            = new Uri(string.Concat("https://image.tmdb.org/t/p/w370_and_h556_bestv2", Result.PosterPath))
                    }
                });

                FrameCover = new Lazy <Frame>(() => new Frame()
                {
                    IsClippedToBounds = true,
                    Margin            = new Thickness(0, 0, 0, 0),
                    HeightRequest     = 556,
                    WidthRequest      = 370,
                    HasShadow         = true,
                    BorderColor       = Color.FromHex("#00000000"),
                    Padding           = new Thickness(0, 0, 0, 0),
                    BackgroundColor   = Color.FromHex("#00000000"),
                    CornerRadius      = 15
                });

                panelContainer = new Lazy <StackLayout>(() => new StackLayout()
                {
                });
                CompressedLayout.SetIsHeadless(panelContainer.Value, true);

                FrameUnderImages = new Lazy <Frame>(() => new Frame()
                {
                    IsClippedToBounds = true,
                    HeightRequest     = 120,
                    BackgroundColor   = Color.Black,
                    CornerRadius      = 5,
                    HasShadow         = true
                });

                ColumnDefinitionCollection columnDefinitions = new ColumnDefinitionCollection()
                {
                    new ColumnDefinition()
                    {
                        Width = new GridLength(1, GridUnitType.Star)
                    },
                    new ColumnDefinition()
                    {
                        Width = GridLength.Star
                    },
                    new ColumnDefinition()
                    {
                        Width = GridLength.Star
                    }
                };

                RowDefinitionCollection rowDefinitions = new RowDefinitionCollection()
                {
                    new RowDefinition()
                    {
                        Height = GridLength.Star
                    },
                    new RowDefinition()
                    {
                        Height = GridLength.Star
                    }
                };

                gridInsideFrame = new Lazy <Grid>(() => new Grid()
                {
                    ColumnDefinitions = columnDefinitions,
                    RowDefinitions    = rowDefinitions
                });

                title = new Lazy <Label>(() => new Label()
                {
                    FontSize       = Device.GetNamedSize(NamedSize.Medium, typeof(Label)),
                    TextColor      = Color.White,
                    LineBreakMode  = LineBreakMode.NoWrap,
                    Margin         = new Thickness(5, 0, 0, 0),
                    FontFamily     = "Arial",
                    FontAttributes = FontAttributes.Bold,
                    Text           = Result.Title
                });

                releaseDate = new Lazy <Label>(() => new Label()
                {
                    FontSize       = Device.GetNamedSize(NamedSize.Small, typeof(Label)),
                    TextColor      = Color.FromHex("#65FFFFFF"),
                    LineBreakMode  = LineBreakMode.NoWrap,
                    Margin         = new Thickness(5, 0, 0, 0),
                    FontFamily     = "Arial",
                    FontAttributes = FontAttributes.Bold,
                    Text           = Result.ReleaseDate
                });

                pin2FavList = new Lazy <Image>(() => new Image()
                {
                    HeightRequest = 40,
                    WidthRequest  = 40
                });
                pin2FavList.Value.SetBinding(Image.SourceProperty, "FavoriteMovie");

                FrameCover.Value.Content = cachedImage.Value;

                gridInsideFrame.Value.Children.Add(title.Value, 0, 0);
                Grid.SetColumnSpan(title.Value, 3);
                gridInsideFrame.Value.Children.Add(releaseDate.Value, 0, 1);
                gridInsideFrame.Value.Children.Add(pin2FavList.Value, 2, 1);

                AbsoluteLayout.SetLayoutBounds(FrameCover.Value, new Rectangle(.5, 1, 1, 1));
                AbsoluteLayout.SetLayoutFlags(FrameCover.Value, AbsoluteLayoutFlags.All);

                FrameUnderImages.Value.Content = gridInsideFrame.Value;

                absoluteLayout.Value.Children.Add(FrameCover.Value);

                panelContainer.Value.Children.Add(FrameUnderImages.Value);

                SubContainer.Value.Children.Add(absoluteLayout.Value);
                CompressedLayout.SetIsHeadless(SubContainer.Value, true);

                Container.Value.Children.Add(SubContainer.Value);
                Container.Value.Children.Add(panelContainer.Value);

                Children.Add(Container.Value);

                var VmInstance = Locator.Current.GetService <AllMoviesPageViewModel>();

                pin2FavList.Value.TapGesture(t =>
                {
                    t.Command          = VmInstance.AddToFavListCommand;
                    t.CommandParameter = Result;
                }).TapGesture(r =>
                {
                    r.Command = new AsyncCommand(async() =>
                    {
                        await pin2FavList.Value.ScaleTo(1.50, 500, Easing.BounceOut);
                        await pin2FavList.Value.ScaleTo(1, 500, Easing.BounceIn);
                    });
                });

                this.TapGesture(t =>
                {
                    t.Command          = VmInstance.NavToDetailsPage;
                    t.CommandParameter = Result;
                });
            }
            catch (Exception ex)
            {
                Debug.WriteLine("Error: " + ex.InnerException);
            }
        }