Ejemplo n.º 1
0
 public override void ViewDidLoad()
 {
     base.ViewDidLoad();
     TransactionsTableView.RegisterNibForCellReuse(RecordTableViewCell.Nib, RecordTableViewCell.Key);
     TransactionsTableView.Source = _viewModel.Transactions.GetTableViewSource(BindTransactionCell, RecordTableViewCell.Key, () => new TableViewSourceExtension <WalletTransaction>(null));
     _viewModel.InitializeWithAccount(_account);
 }
        // Having a bad day with the designer
        private void LayoutViews()
        {
            // +1 of width due to weird pixel on far right
            var balanceBackground = new UIImageView(new CGRect(0, 0, UIScreen.MainScreen.Bounds.Width + 1, 207))
            {
                Image = UIImage.FromBundle("BalanceBackground")
            };

            balanceBackground.ContentMode = UIViewContentMode.ScaleAspectFill;
            View.AddSubview(balanceBackground);
            // Balance Label
            BalanceLabel.Layer.ZPosition = 1;
            BalanceLabel.Center          = balanceBackground.Center;

            TransactionsTableView.Center = new CGPoint(View.Center.X, View.Center.Y);

            // Pull to refresh control
            refreshControl           = new UIRefreshControl();
            refreshControl.TintColor = UIColor.Gray;
            var attributedString = new NSAttributedString("Getting Latest Transactions",
                                                          new CTStringAttributes()
            {
                ForegroundColorFromContext = true,
                Font = new CTFont("Lato-Regular", 12)
            });

            refreshControl.AttributedTitle = attributedString;
            refreshControl.ValueChanged   += RefreshControl_ValueChanged;
            TransactionsTableView.AddSubview(refreshControl);
        }
Ejemplo n.º 3
0
        private void TransactionSelected(object item)
        {
            var transactions = _viewModel.Transactions.ToList();
            var transaction  = transactions.First(t => t.Id.Equals((item as WalletTransaction).Id));
            var index        = transactions.IndexOf(transaction);
            var indexPath    = NSIndexPath.FromRowSection(index, 0);

            _viewModel.SelectTransactionAction.Execute(transaction.Id);
            TransactionsTableView.DeselectRow(indexPath, true);
        }
        private void Transactions_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
        {
            dataSource = new TransactionsListDataSource(viewModel.Transactions);

            TransactionsTableView.Source = dataSource;
            TransactionsTableView.ReloadData();

            if (viewModel.Transactions.Count > 0)
            {
                View.BringSubviewToFront(TransactionsTableView);
            }
        }
Ejemplo n.º 5
0
        public void Configure(ITransactionsWidgetViewModel viewModel)
        {
            if (!_configured)
            {
                _viewModel = viewModel;

                TitleLabel.Text = "Transactions";
                TransactionsTableView.RegisterNibForCellReuse(RecordTableViewCell.Nib, RecordTableViewCell.Key);
                TransactionsTableView.Source = _viewModel.Transactions.GetTableViewSource(BindTransactionCell, RecordTableViewCell.Key, () => new TableViewSourceExtension <WalletTransaction>(TransactionSelected));

                MoreButton.SetCommand(_viewModel.MoreButtonAction);
                _configured = true;
            }
        }
 public override void ViewDidLoad()
 {
     base.ViewDidLoad();
     TransactionsTableView.RegisterNibForCellReuse(RecordTableViewCell.Nib, RecordTableViewCell.Key);
     TransactionsTableView.Source = _viewModel.Transactions.GetTableViewSource(BindTransactionCell, RecordTableViewCell.Key, () => new TableViewSourceExtension <WalletTransaction>(TransactionSelected));
 }