public OpponentAdvertDetailsPage(OpponentAdvertMenuViewModel model) { InitializeComponent(); NavigationPage nav = App.Current.MainPage as NavigationPage; nav.BarBackgroundColor = Color.White; mainModel = model; lblDate.Text = model.AdvertDate; lblTime.Text = model.MinMaxTimeStr; lblTeamName.Text = model.Advert.Team.Name; lblUserName.Text = model.OwnerName; lblVisitProfile.Text = model.OwnerName + " kullanıcısının profilini gör"; lblMessageToUser.Text = model.OwnerName + " kullanıcısına mesaj at"; imgProfilePicture.Source = model.Advert.RandomLine5; if (model.Advert.District1 == "Tüm İlçeler") { lblCityAndTown.Text = "Tüm İlçeler"; } else { lblCityAndTown.Text = model.Advert.District1 + "," + model.Advert.District2 + "," + model.Advert.District3; } if (model.Advert.RandomLine6 != null) { lblAdvertInfo.Text = model.Advert.RandomLine6; } else { lblAdvertInfo.Text = " -İlan bilgisi paylaşılmamış- "; } FillList(); }
private async void LstOpponentAdverts_SelectionChanged(object sender, SelectionChangedEventArgs e) { if (lstOpponentAdverts.SelectedItem != null) { OpponentAdvertMenuViewModel model = new OpponentAdvertMenuViewModel(); model = lstOpponentAdverts.SelectedItem as OpponentAdvertMenuViewModel; await Navigation.PushAsync(new OpponentAdvertDetailsPage(model)); } }
private async void FrameReqTapped_Tapped(object sender, EventArgs e) { Frame frm = (Frame)sender; MixedRequestsViewModel model = frm.BindingContext as MixedRequestsViewModel; if (model.Type == "Oyuncu İlanı") { string option; if (model.AdvertRequestPlayer.isApprovedSituation != "Denied") { option = await DisplayActionSheet("Seçenekler", "Vazgeç", "Tamam", new string[] { "İlanı gör", "İsteği sil" }); } else { option = await DisplayActionSheet("Seçenekler", "Vazgeç", "Tamam", new string[] { "İlanı gör" }); } if (option == "İlanı gör") { await Navigation.PushAsync(new PlayerAdvertDetailsPage(model.PlayerAdvert)); } else if (option == "İsteği sil") { await Navigation.PushAsync(new DeleteAdvertRequestPage("Oyuncu İlanı", model.AdvertRequestPlayer, null)); } } else { string option; if (model.AdvertRequestOpponent.isApprovedSituation != "Denied") { option = await DisplayActionSheet("Seçenekler", "Vazgeç", "Tamam", new string[] { "İlanı gör", "İsteği sil" }); } else { option = await DisplayActionSheet("Seçenekler", "Vazgeç", "Tamam", new string[] { "İlanı gör" }); } if (option == "İlanı gör") { OpponentAdvertMenuViewModel _model = new OpponentAdvertMenuViewModel() { Advert = model.OpponentAdvert }; await Navigation.PushAsync(new OpponentAdvertDetailsPage(_model)); } else { await Navigation.PushAsync(new DeleteAdvertRequestPage("Rakip İlanı", null, model.AdvertRequestOpponent)); } } }
private async void TapSeeAdvert_Tapped(object sender, EventArgs e) { if (messagesPageViewModel.PlayerAdvert != null && messagesPageViewModel.OpponentAdvert == null) { if (messagesPageViewModel.PlayerAdvert.UserId == currentUser.Id) { messagesPageViewModel.PlayerAdvert.User = currentUser; await Navigation.PushAsync(new PlayerAdvertDetailsPage(messagesPageViewModel.PlayerAdvert)); } else { messagesPageViewModel.PlayerAdvert.User = messagesPageViewModel.OtherUser; await Navigation.PushAsync(new PlayerAdvertDetailsPage(messagesPageViewModel.PlayerAdvert)); } } else if (messagesPageViewModel.PlayerAdvert == null && messagesPageViewModel.OpponentAdvert != null) { OpponentAdvertMenuViewModel vm = new OpponentAdvertMenuViewModel() { Advert = messagesPageViewModel.OpponentAdvert }; await Navigation.PushAsync(new OpponentAdvertDetailsPage(vm)); } }