public void Bind(IOrderContent model)
            {
                CellContentRootView?.SetBackgroundColor(ColorConstants.BackroundCell, 5);

                CategoryImage?.SetImageFromUrl(model.ImagePath);

                if (!ItemNameText.IsNull())
                {
                    ItemNameText.Text = model.OrderName;
                    ItemNameText?.SetTextColor(ColorConstants.WhiteColor);
                    ItemNameText.SetFont(FontsConstant.OpenSansBold, FontsConstant.Size14);
                }

                if (!PriceText.IsNull())
                {
                    PriceText.Text = "€" + model.Price * Convert.ToInt32(model.Quantity);
                    PriceText?.SetTextColor(ColorConstants.SelectorHome);
                    PriceText?.SetFont(FontsConstant.OpenSansBold, FontsConstant.Size14);
                }

                if (QuantityText.IsNull())
                {
                    return;
                }
                QuantityText.Text = model.Quantity + " pcs";
                QuantityText?.SetTextColor(ColorConstants.WhiteColor);
                QuantityText?.SetFont(FontsConstant.OpenSansBold, FontsConstant.Size14);
            }
Exemple #2
0
            public void Bind(IOrderContent model)
            {
                CellContentRootView?.SetBackgroundColor(ColorConstants.BackroundCell, 5);
                CategoryImage?.SetImageFromUrl(model.ImagePath);

                if (!RemoveOrderImage.IsNull())
                {
                    RemoveOrderImage?.SetImageFromResource(DrawableConstants.OrderRemoveIcon);

                    RemoveOrderImage.Tag = model;

                    RemoveOrderImage.Click -= RemoveOrderImage_Click;
                    RemoveOrderImage.Click += RemoveOrderImage_Click;
                }

                if (!ItemNameText.IsNull())
                {
                    ItemNameText.Text = model.OrderName;
                    ItemNameText?.SetTextColor(ColorConstants.WhiteColor);
                    ItemNameText.SetFont(FontsConstant.OpenSansBold, FontsConstant.Size14);
                }

                if (!PriceText.IsNull())
                {
                    PriceText.Text = "€" + model.Price * Convert.ToInt32(model.Quantity);
                    PriceText?.SetTextColor(ColorConstants.SelectorHome);
                    PriceText?.SetFont(FontsConstant.OpenSansBold, FontsConstant.Size14);
                }

                if (!MinusText.IsNull())
                {
                    MinusText?.SetTextColor(ColorConstants.WhiteColor);
                    MinusText?.SetFont(FontsConstant.OpenSansRegular, FontsConstant.Size20);
                    MinusText?.SetBackgroundColor(ColorConstants.SelectorHome, type: RadiusType.Aspect);
                    MinusText?.SetSelectedColor(ColorConstants.SelectorHome.SelectorTransparence(ColorConstants.Procent50));
                    MinusText.Text = "-";
                    MinusText.Tag  = new { Model = model };

                    MinusText.Click -= MinusText_Click;
                    MinusText.Click += MinusText_Click;
                }

                if (!QuantityText.IsNull())
                {
                    QuantityText.Text = model.Quantity;
                    QuantityText?.SetTextColor(ColorConstants.WhiteColor);
                    QuantityText?.SetFont(FontsConstant.OpenSansBold, FontsConstant.Size14);
                }

                if (PlusText.IsNull())
                {
                    return;
                }
                PlusText?.SetTextColor(ColorConstants.WhiteColor);
                PlusText?.SetFont(FontsConstant.OpenSansRegular, FontsConstant.Size20);
                PlusText.Text = "+";
                PlusText?.SetBackgroundColor(ColorConstants.SelectorHome, type: RadiusType.Aspect);
                PlusText?.SetSelectedColor(ColorConstants.SelectorHome.SelectorTransparence(ColorConstants.Procent50));

                PlusText.Tag = new { Model = model };

                PlusText.Click -= PlusText_Click;
                PlusText.Click += PlusText_Click;
            }