protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); // Create your application here SetContentView(Resource.Layout.CartView); _cartDataService = new CartDataService(); _cartListView = FindViewById <ListView>(Resource.Id.cartListView); _cartItems = _cartDataService.GetCart().CartItems; _cartListView.Adapter = new CartAdapter(this, _cartItems); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.CartView); cartDataService = new CartDataService(); cartListView = FindViewById <ListView>(Resource.Id.cartListView); var orderButton = FindViewById <Button>(Resource.Id.placeOrderButton); orderButton.Click += OrderButton_Click; cartItems = cartDataService.GetCart().CartItems; cartListView.Adapter = new CartAdapter(this, cartItems); }
public CartViewPage() { InitializeComponent(); cartDataService = new CartDataService(); Items = new ObservableCollection <Models.CartItem>(); MyListView.ItemsSource = cartDataService.GetCart().CartItems; MyListView.HasUnevenRows = true; TotalLabel.Text = cartDataService.GetCartTotal().ToString("C2"); CheckoutButton.Clicked += CheckoutButton_Clicked; ContinueOrderingButton.Clicked += ContinueOrderingButton_Clicked; }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.CartView); cartDataService = new CartDataService(); FindViews(); cartItems = cartDataService.GetCart().CartItems; cartListView.Adapter = new CartAdapter(this, cartItems); BindData(); HandleEvents(); }
public CartDataSource() { cartDataService = new CartDataService(); cartItems = cartDataService.GetCart().CartItems; }
private void InitializeData() { CartItems = CartDataService.GetCart().CartItems.ToObservableCollection(); }