protected override void OnBindingContextChanged() { base.OnBindingContextChanged(); card.BackgroundColor = Color.FromHex(BGColour); var tap = new TapGestureRecognizer(); tap.Tapped += (s, e) => { var args = new BuyRoundArgs() { Group = (GroupDto)this.BindingContext }; SummaryVM.OnBuyCommandExecuted(args); }; card.GestureRecognizers.Add(tap); if (BindingContext != null && ((GroupDto)BindingContext).WhoseShout != null && !String.IsNullOrEmpty(((GroupDto)BindingContext).WhoseShout.AvatarUrl)) { initials.IsVisible = false; } //WebImage.Source = Settings.Current.AvatarUrl; //circle2.Source = Settings.Current.AvatarUrl; //Random r = new Random(); //if (r.Next(2) % 2 == 0) //{ // categoryImage.Source = "ic_food_croissant_white_48dp.png"; //} //BuyRound.Clicked += BuyRound_Clicked; }
public async void OnBuyCommandExecuted(BuyRoundArgs e) { var cost = e.Group.Records.Count > 0 ? e.Group.Records.Last().Cost : 0; var shoutID = e.Group.WhoseShout != null ? e.Group.WhoseShout.ID : Guid.Empty; NavigationParameters nav = new NavigationParameters(); nav.Add("model", new RecordDto() { ID = Guid.NewGuid(), GroupID = e.Group.ID, GroupName = e.Group.Name, Cost = cost, UserID = shoutID }); nav.Add("group", e.Group); await _navigationService.NavigateAsync("BuyPage", nav); }