Logout Display alert xamarin.forms

前端 未结 2 1254
野的像风
野的像风 2021-01-15 17:36

I\'ve been trying to allow a user to confirm logout by using DisplayAlert. If they click \"No\" it should remain in their profile page else they should be redirected back to

2条回答
  •  鱼传尺愫
    2021-01-15 17:59

    DisplayAlert returns a boolean (true / false):

    var answer = await DisplayAlert("Exit", "Do you wan't to exit the App?", "Yes", "No");
    if (answer)
    {
        // User choose Yes
    }
    else
    {
        // User choose No
    }
    

提交回复
热议问题