public async void ClickDelete(object sender, EventArgs args) { bool action = await DisplayAlert("Warning", "Do you want to delete this log?", "Yes", "No"); if (action == true) { bool deleted = await logServices.DeleteLogByIdAsync(logId); if (deleted == true) { string value = ProjectList.SelectedItem.ToString(); int projectid = 0; //Zoekt id van project foreach (var project in projectsWithKey) { if (project.Value == value) { projectid = project.Key; } } Application.Current.MainPage = new ProjectInfo(log.ProjectID); } } }