public override void ViewDidLoad() { base.ViewDidLoad(); money_label.Text = AppData.Coins.myCoins[0].ToString(); try { AppData.AvailableItems.LoadCats(); } catch { } ShopTableViewSource source = new ShopTableViewSource(AppData.AvailableItems.Cats); source.SelectButtonTapped -= OnSelectedButtonTapped; source.SelectButtonTapped += OnSelectedButtonTapped; ShopTableView.Source = source; ShopTableView.RowHeight = UITableView.AutomaticDimension; ShopTableView.EstimatedRowHeight = 40f; }
partial void ShopTypeChanged(UISegmentedControl sender) { var index = item_type.SelectedSegment; if (index == 0) { try { AppData.AvailableItems.LoadCats(); } catch { } ShopTableViewSource source = new ShopTableViewSource(AppData.AvailableItems.Cats); source.SelectButtonTapped -= OnSelectedButtonTapped; source.SelectButtonTapped += OnSelectedButtonTapped; ShopTableView.Source = source; ShopTableView.RowHeight = UITableView.AutomaticDimension; ShopTableView.EstimatedRowHeight = 40f; ShopTableView.ReloadData(); } if (index == 1) { try { AppData.AvailableItems.LoadPatterns(); } catch { } ShopTableViewSource source = new ShopTableViewSource(AppData.AvailableItems.Patterns); source.SelectButtonTapped -= OnSelectedButtonTapped; source.SelectButtonTapped += OnSelectedButtonTapped; ShopTableView.Source = source; ShopTableView.RowHeight = UITableView.AutomaticDimension; ShopTableView.EstimatedRowHeight = 100f; ShopTableView.ReloadData(); } }