public SurveyPage() { InitializeComponent(); this.BindingContext = surveyMVVM = new SurveyMVVM(this); //NavigationPage.SetTitleIcon(this, "navIcon"); //TODO MVVM DUZELT TAM OLARAK ! MessagingCenter.Subscribe <NewsFeedViewModel, string>(this, "keySurveyAnnc", async(arg1, key) => { await getQuestionDetail(key); MessagingCenter.Instance.Unsubscribe <NewsFeedViewModel, string>(this, "keySurveyAnnc"); }); MessagingCenter.Subscribe <NotifyViewModel, string>(this, "keySurveyAnnc", async(arg1, key) => { await getQuestionDetail(key); MessagingCenter.Instance.Unsubscribe <NotifyViewModel, string>(this, "keySurveyAnnc"); }); MessagingCenter.Subscribe <App, string>(this, MCenter.dataSurvey.ToString(), async(arg1, key) => { MessagingCenter.Unsubscribe <App, string>(this, MCenter.dataSurvey.ToString()); await getQuestionDetail(key); }); }
async public void saveUserResponse() { var mvvmHelper = new SurveyMVVM(this); //loading bar eklenecek string resp = string.Empty; await Navigation.PushPopupAsync(new LoadingPopPage(), true); resp = await service.saveUserReply(responseList, questionKey, child); await Navigation.PopPopupAsync(true); await Navigation.PopAllPopupAsync(true); if (!string.IsNullOrEmpty(resp)) { await DisplayAlert("Tamamlandı", "Cevaplarınız alındı teşekür ederiz.", "Kapat"); MessagingCenter.Send <SurveyQuestionList, string>(this, MCenter.deleteSurveyKey.ToString(), questionKey); await Navigation.PopAsync(); } else { var chooseBtn = await DisplayAlert("Hata", "Bir problemle karşılaşıldı", "Tekrar dene", "Geri Dön"); if (chooseBtn) { saveUserResponse(); } else { await Navigation.PopAsync(); } } }