Ejemplo n.º 1
0
            public InvoiceView(UIViewController parent)
            {
                BackgroundColor = Theme.Current.BackgroundGray;
                //Add(backgroundView = new UIImageView(UIImage.FromBundle("PaymentBG").Blur(50)));
                Add(InvoiceTable = new InvoiceTableView());
                Add(SideBar      = new InvoiceSideBar {
                    Checkout = () => {
                        Parent.Checkout();
                    }
                });
                Add(BottomView = new InvoiceBottomView(parent)
                {
                    AddItem = async(i) => {
                        var c = i as Coupon;
                        if (c != null && c.ManualDiscount)
                        {
                            var amount = await AskForValue("Coupon Amount", "");
                            if (amount == 0)
                            {
                                return;
                            }
                            i.Price = amount;
                        }
                        Invoice.AddItem(i);
                    }
                });

                this.ConstrainLayout(() =>
//					backgroundView.Frame.X == Frame.X &&
//					backgroundView.Frame.Width == Frame.Width &&
//					backgroundView.Frame.Height == Frame.Height &&
//					backgroundView.Frame.Top == Frame.Top &&

                                     BottomView.Frame.Right == Frame.Right &&
                                     BottomView.Frame.Width == Frame.Width &&
                                     BottomView.Frame.Bottom == Frame.Bottom &&
                                     BottomView.Frame.Height == bottomHeight

                                     &&

                                     SideBar.Frame.Right == Frame.Right &&
                                     SideBar.Frame.Width == sideBarWidth &&
                                     SideBar.Frame.Bottom == BottomView.Frame.Top &&
                                     SideBar.Frame.Top == Frame.Top

                                     &&

                                     InvoiceTable.Frame.Left == Frame.Left &&
                                     InvoiceTable.Frame.Right == SideBar.Frame.Left &&
                                     InvoiceTable.Frame.Bottom == BottomView.Frame.Top &&
                                     InvoiceTable.Frame.Top == Frame.Top
                                     );
            }
Ejemplo n.º 2
0
			public InvoiceView (UIViewController  parent)
			{
				BackgroundColor = Theme.Current.BackgroundGray;
				//Add(backgroundView = new UIImageView(UIImage.FromBundle("PaymentBG").Blur(50)));
				Add (InvoiceTable = new InvoiceTableView ());
				Add (SideBar = new InvoiceSideBar {
					Checkout = () => {
						Parent.Checkout ();
					}
				});
				Add (BottomView = new InvoiceBottomView (parent) {
					AddItem = async (i) => {
						var c = i as Coupon;
						if(c != null && c.ManualDiscount)
						{
							var amount = await AskForValue("Coupon Amount","");
							if(amount == 0)
								return;
							i.Price = amount;
						}
						Invoice.AddItem (i);
					}
				});

				this.ConstrainLayout (() => 
//					backgroundView.Frame.X == Frame.X &&
//					backgroundView.Frame.Width == Frame.Width &&
//					backgroundView.Frame.Height == Frame.Height &&
//					backgroundView.Frame.Top == Frame.Top &&

					BottomView.Frame.Right == Frame.Right &&
				BottomView.Frame.Width == Frame.Width &&
				BottomView.Frame.Bottom == Frame.Bottom &&
				BottomView.Frame.Height == bottomHeight

				&&

				SideBar.Frame.Right == Frame.Right &&
				SideBar.Frame.Width == sideBarWidth &&
				SideBar.Frame.Bottom == BottomView.Frame.Top &&
				SideBar.Frame.Top == Frame.Top

				&&

				InvoiceTable.Frame.Left == Frame.Left &&
				InvoiceTable.Frame.Right == SideBar.Frame.Left &&
				InvoiceTable.Frame.Bottom == BottomView.Frame.Top &&
				InvoiceTable.Frame.Top == Frame.Top 
				);
			}