Esempio n. 1
0
        public void UpdateCell(Person person)
        {
            if (person == null) {
                return;
            }

            var balance = FinancerModel.GetBalance (person);

            this.DirectionImage.Image = person.UIImage;
            this.NameLabel.Text = person.ToString ();
            this.AmountLabel.Text = balance.ToString ("0.00") + " лв.";
            this.AmountLabel.TextColor = GetAmountColor (balance);
        }
Esempio n. 2
0
 public static void Initialize()
 {
     InitDummyTransactions ();
     CurrentUser = FinancerModel.GetCurrentUser();
 }
        private void SetupTableViews()
        {
            this.currentCategory = this.Transaction == null ? FinancerModel.GetCategories ().FirstOrDefault () : this.Transaction.Category;
            this.categorySource = new CategoriesSource (new[] { this.currentCategory }.GetCategoriesDictionary ());
            this.categorySource.HeaderText = "Category";
            this.categorySource.Callback = (c) => {
                this.PerformSegue(this.IsEditing ? SelectCategorySegue : ReviewCategorySegue, this);
            };
            this.CategoryTableView.Source = this.categorySource;
            this.CategoryTableView.AlwaysBounceVertical = false;

            this.currentPerson = this.Transaction == null ? FinancerModel.GetOtherPeople ().FirstOrDefault () : this.Transaction.Contact;
            this.peopleSource = new PeopleSource (new[] { this.currentPerson }.GetPeopleDictionary());
            this.peopleSource.Callback = (p) => {
                this.PerformSegue(this.IsEditing ? SelectPersonSegue : ReviewPersonSegue, this);
            };
            this.peopleSource.HeaderText = "Contact";
            this.PersonTableView.Source = this.peopleSource;
            this.PersonTableView.AlwaysBounceVertical = false;
        }