public async void Execute(object parameter) { var response = await App.Current.MainPage.DisplayActionSheet("Möchten Sie diese Geometrie vom Gerät entfernen?", "Abbrechen", "Entfernen"); if (response == "Entfernen") { var geom = parameter as ReferenceGeometry; ReferenceGeometry.DeleteGeometry(geom.Id); } }
/// <summary> /// Delete a geometry /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private async void DeleteButton_Clicked(object sender, EventArgs e) { string formAction = await DisplayActionSheet("Möchten Sie diese Geometrie vom Gerät entfernen?", "Abbrechen", "Entfernen"); if (formAction == "Entfernen") { GroupedFormRec formRec = ((Button)sender).BindingContext as GroupedFormRec; var geom = formRec.Geom; if (ViewModel.Object_pk == geom.Id) { ViewModel.Object_pk = null; } ReferenceGeometry.DeleteGeometry(geom.Id); } }