public async void DeleteFinishedTask() { try { if (Mwm.GreenkeeperInfoToDelete == null) { throw new Exception(); } PersistencyService.DeleteFinishedTask(Mwm.GreenkeeperInfoToDelete.FinishedTasksID); Mwm.GreenkeeperInfoCollection.Clear(); await Mwm.GreenkeeperInfoHandler.GetGreenTaskInfoCollection(); ContentDialog cd = new ContentDialog(); cd.Content = "Din opgave er slettet"; cd.PrimaryButtonText = "OK"; await cd.ShowAsync(); } catch (Exception) { ContentDialog cd = new ContentDialog(); cd.Content = "Vælg venligst en opgave"; cd.PrimaryButtonText = "OK"; await cd.ShowAsync(); } }