public LoadInvoiceViewController ()
		{
			Title = "Load Invoice";
			NavigationItem.RightBarButtonItem = new UIBarButtonItem (UIBarButtonSystemItem.Refresh,(s,e) => ReloadData());
			View = TableView = new ObservableTableView {
				CellIdentifier = InvoiceCell.Key,
				CreateCellFunc = () => new InvoiceCell (),
				BindCellAction = (cell,obj) => (cell as InvoiceCell).Invoice = obj as Invoice,
				ItemTapped = (i) =>{
					if(InvoiceSelected != null)
						InvoiceSelected(i as Invoice);
				},
			};

		}
Beispiel #2
0
 public LoadInvoiceViewController()
 {
     Title = "Load Invoice";
     NavigationItem.RightBarButtonItem = new UIBarButtonItem(UIBarButtonSystemItem.Refresh, (s, e) => ReloadData());
     View = TableView = new ObservableTableView {
         CellIdentifier = InvoiceCell.Key,
         CreateCellFunc = () => new InvoiceCell(),
         BindCellAction = (cell, obj) => (cell as InvoiceCell).Invoice = obj as Invoice,
         ItemTapped     = (i) => {
             if (InvoiceSelected != null)
             {
                 InvoiceSelected(i as Invoice);
             }
         },
     };
 }
		public override void LoadView ()
		{
			View = new ObservableTableView ();
		}
			public PaymentView ()
			{
				const float rowHeight = 80;
				BackgroundColor = UIColor.FromPatternImage(UIImage.FromBundle("homeScreen"));
				Add (backgroundView = new UIView {
					BackgroundColor = UIColor.Black.ColorWithAlpha (.5f),
					ClipsToBounds = true,
					Layer = {
						BorderColor = UIColor.White.ColorWithAlpha (.75f).CGColor,
						BorderWidth = .5f,
						CornerRadius = 5,
					},
				});
				backgroundView.Add (TotalLabel = new UILabel ());
				backgroundView.Add (tableView = new ObservableTableView (UITableViewStyle.Grouped) {
					ContentInset = new UIEdgeInsets (-36, 0, 0, 0),
					BackgroundColor = UIColor.Clear,
					CellIdentifier = PaymentCell.Key,
					CreateCellFunc = () => new PaymentCell (),
					RowHeight = rowHeight,
					BindCellAction = (cell, item) => {
						(cell as PaymentCell).Payment = item as Payment;
					},
					ItemTapped = (p) =>{
						Invoice.PaymentSelected(p as Payment);
					},
				});
				var bgColor = UIColor.Black.ColorWithAlpha(.3f);
				backgroundView.Add (rightTableView = new UITableView (RectangleF.Empty, UITableViewStyle.Grouped) {
					ContentInset = new UIEdgeInsets (-36, 0, 0, 0),
					SectionHeaderHeight = 0,
					BackgroundColor = UIColor.Clear,
					ScrollEnabled = false,
					RowHeight = 60,
					Source = new CellTableViewSource {
						(onAccountCell = new SubTotalCell {
							Frame = new RectangleF (0, 0, 320, 50),
							TextLabel = {
								Text = "On Account"
							},
							BackgroundColor = bgColor
						}),
						(totalCell = new SubTotalCell {
							Frame = new RectangleF (0, 0, 320, 50),
							TextLabel = {
								Text = "Total"
							},
							BackgroundColor = bgColor
						}),
						(remaining = new TotalCell {
							Frame = new RectangleF (0, 0, 320, 65),
							TextLabel = {
								Text = "Remaining",
								TextColor = Theme.Current.PayColor,
							},
							DetailTextLabel = {
								Font = UIFont.BoldSystemFontOfSize(25),
							},
							BackgroundColor = bgColor
						}),
						(change = new TotalCell {
							Frame = new RectangleF (0, 0, 320, rowHeight),
							TextLabel = {
								Text = "Change",
								TextColor = UIColor.White,
							},
							DetailTextLabel = {
								TextColor = UIColor.White,
							},
							BackgroundColor = bgColor,
							SeparatorInset = new UIEdgeInsets (0, 0, 0, 0),
						}),
						new PayCell {
							Frame = new RectangleF (0, 0, 320, 76),
							Text = "Post",
							Tapped = async () =>{
								if(PostInvoice != null)
									PostInvoice();
							}
						}
					}
				});

				backgroundView.Add(five = new TintedButton{
					Title = "$5",
					TitleColor = UIColor.White.ColorWithAlpha(.75f),
					SelectedTintColor = Theme.Current.PayColor,
				});
				five.TouchUpInside += (object sender, EventArgs e) => {
					Invoice.CashPayment.Amount = 5;
				};
				five.SizeToFit();

				backgroundView.Add(ten = new TintedButton{
					Title = "$10",
					TitleColor = UIColor.White.ColorWithAlpha(.75f),
					SelectedTintColor = Theme.Current.PayColor,
				});
				ten.TouchUpInside += (object sender, EventArgs e) => {
					Invoice.CashPayment.Amount = 10;
				};
				ten.SizeToFit();

				backgroundView.Add(twenty = new TintedButton{
					Title = "$20",
					TitleColor = UIColor.White.ColorWithAlpha(.75f),
					SelectedTintColor = Theme.Current.PayColor,
				});
				twenty.TouchUpInside += (object sender, EventArgs e) => {
					Invoice.CashPayment.Amount = 20;
				};
				twenty.SizeToFit();

				backgroundView.Add(fifty = new TintedButton{
					Title = "$50",
					TitleColor = UIColor.White.ColorWithAlpha(.75f),
					SelectedTintColor = Theme.Current.PayColor,
				});
				fifty.TouchUpInside += (object sender, EventArgs e) => {
					Invoice.CashPayment.Amount = 50;
				};
				fifty.SizeToFit();

				backgroundView.Add(hundred = new TintedButton{
					Title = "$100",
					TitleColor = UIColor.White.ColorWithAlpha(.75f),
					SelectedTintColor = Theme.Current.PayColor,
				});
				hundred.TouchUpInside += (object sender, EventArgs e) => {
					Invoice.CashPayment.Amount = 100;
				};
				hundred.SizeToFit();


			}
Beispiel #5
0
 public ObservableTableSource(ObservableTableView controller)
 {
     this.controller = controller;
 }
Beispiel #6
0
 public ObservableTableSource(ObservableTableView controller)
 {
     this.controller = controller;
 }
 public override void LoadView()
 {
     View = new ObservableTableView();
 }
            public PaymentView()
            {
                const float rowHeight = 80;

                BackgroundColor    = UIColor.FromPatternImage(UIImage.FromBundle("homeScreen"));
                Add(backgroundView = new UIView {
                    BackgroundColor = UIColor.Black.ColorWithAlpha(.5f),
                    ClipsToBounds   = true,
                    Layer           =
                    {
                        BorderColor  = UIColor.White.ColorWithAlpha(.75f).CGColor,
                        BorderWidth  =                                        .5f,
                        CornerRadius =                                          5,
                    },
                });
                backgroundView.Add(TotalLabel = new UILabel());
                backgroundView.Add(tableView  = new ObservableTableView(UITableViewStyle.Grouped)
                {
                    ContentInset    = new UIEdgeInsets(-36, 0, 0, 0),
                    BackgroundColor = UIColor.Clear,
                    CellIdentifier  = PaymentCell.Key,
                    CreateCellFunc  = () => new PaymentCell(),
                    RowHeight       = rowHeight,
                    BindCellAction  = (cell, item) => {
                        (cell as PaymentCell).Payment = item as Payment;
                    },
                    ItemTapped = (p) => {
                        Invoice.PaymentSelected(p as Payment);
                    },
                });
                var bgColor = UIColor.Black.ColorWithAlpha(.3f);

                backgroundView.Add(rightTableView = new UITableView(RectangleF.Empty, UITableViewStyle.Grouped)
                {
                    ContentInset        = new UIEdgeInsets(-36, 0, 0, 0),
                    SectionHeaderHeight = 0,
                    BackgroundColor     = UIColor.Clear,
                    ScrollEnabled       = false,
                    RowHeight           = 60,
                    Source = new CellTableViewSource {
                        (onAccountCell = new SubTotalCell {
                            Frame = new RectangleF(0, 0, 320, 50),
                            TextLabel =
                            {
                                Text = "On Account"
                            },
                            BackgroundColor = bgColor
                        }),
                        (totalCell = new SubTotalCell {
                            Frame = new RectangleF(0, 0, 320, 50),
                            TextLabel =
                            {
                                Text = "Total"
                            },
                            BackgroundColor = bgColor
                        }),
                        (remaining = new TotalCell {
                            Frame = new RectangleF(0, 0, 320, 65),
                            TextLabel =
                            {
                                Text      = "Remaining",
                                TextColor = Theme.Current.PayColor,
                            },
                            DetailTextLabel =
                            {
                                Font = UIFont.BoldSystemFontOfSize(25),
                            },
                            BackgroundColor = bgColor
                        }),
                        (change = new TotalCell {
                            Frame = new RectangleF(0, 0, 320, rowHeight),
                            TextLabel =
                            {
                                Text      = "Change",
                                TextColor = UIColor.White,
                            },
                            DetailTextLabel =
                            {
                                TextColor = UIColor.White,
                            },
                            BackgroundColor = bgColor,
                            SeparatorInset = new UIEdgeInsets(0, 0, 0, 0),
                        }),
                        new PayCell {
                            Frame  = new RectangleF(0, 0, 320, 76),
                            Text   = "Post",
                            Tapped = async() => {
                                if (PostInvoice != null)
                                {
                                    PostInvoice();
                                }
                            }
                        }
                    }
                });

                backgroundView.Add(five = new TintedButton {
                    Title             = "$5",
                    TitleColor        = UIColor.White.ColorWithAlpha(.75f),
                    SelectedTintColor = Theme.Current.PayColor,
                });
                five.TouchUpInside += (object sender, EventArgs e) => {
                    Invoice.CashPayment.Amount = 5;
                };
                five.SizeToFit();

                backgroundView.Add(ten = new TintedButton {
                    Title             = "$10",
                    TitleColor        = UIColor.White.ColorWithAlpha(.75f),
                    SelectedTintColor = Theme.Current.PayColor,
                });
                ten.TouchUpInside += (object sender, EventArgs e) => {
                    Invoice.CashPayment.Amount = 10;
                };
                ten.SizeToFit();

                backgroundView.Add(twenty = new TintedButton {
                    Title             = "$20",
                    TitleColor        = UIColor.White.ColorWithAlpha(.75f),
                    SelectedTintColor = Theme.Current.PayColor,
                });
                twenty.TouchUpInside += (object sender, EventArgs e) => {
                    Invoice.CashPayment.Amount = 20;
                };
                twenty.SizeToFit();

                backgroundView.Add(fifty = new TintedButton {
                    Title             = "$50",
                    TitleColor        = UIColor.White.ColorWithAlpha(.75f),
                    SelectedTintColor = Theme.Current.PayColor,
                });
                fifty.TouchUpInside += (object sender, EventArgs e) => {
                    Invoice.CashPayment.Amount = 50;
                };
                fifty.SizeToFit();

                backgroundView.Add(hundred = new TintedButton {
                    Title             = "$100",
                    TitleColor        = UIColor.White.ColorWithAlpha(.75f),
                    SelectedTintColor = Theme.Current.PayColor,
                });
                hundred.TouchUpInside += (object sender, EventArgs e) => {
                    Invoice.CashPayment.Amount = 100;
                };
                hundred.SizeToFit();
            }