private void model_gameAdded(object sender, GameAddedEventArgs e) { Games.Add(new GameButton { Content = e.Name, Started = false, Index = e.Index, ButtonCommand = new DelegateCommand(button => ButtonClick(button as GameButton)) }); OnPropertyChanged("Games"); }
private void OnGameAdded(object sender, GameAddedEventArgs args) { RunOnUiThread(() => { ListView gameList = FindViewById <ListView>(Resource.Id.gb_List); TextView txtStatus = FindViewById <TextView>(Resource.Id.gb_Status); if (gameList != null) { gameList.Adapter = new GameInstanceArrayAdapter(this, JoinGame, args.Games); } if (txtStatus != null) { txtStatus.Text = $"{((args.Games.Count > 0) ? args.Games.Count.ToString() : "No")} Game{(args.Games.Count == 1 ? "" : "s")} Found"; } }); }