0
var response = await App.PhrasespageCS.DisplayAlert("Reset score",
"You have more than 50 points. Are you sure you want to reset it to 0?",
"Yes", "No");
if (response == true)
{
App.DB.ResetPointsForSelectedPhrase(App.cfs);
}
我不清楚在這裏等待的使用,並希望建議。這也可以合併成一個聲明?這是在Xamarin Forms中處理響應的正確方法嗎?
等待意味着您等待對話框創建並回答。是的,認爲這是處理對話響應的正確方式,儘管你不必寫回應==真,你可以簡單地把響應 –