private async void EditSubkindExecute() { Debug.WriteLine("EditSubkindExecute"); Subkind subkind = OpenMenuFlyoutAction.HoldedObject as Subkind; if (subkind == null) { Debug.WriteLine("Invalid subkind to edit..."); return; } Debug.WriteLine("Subkind to edit: " + subkind.ToString()); string result = await dialogService.ShowMessage("Edit Subkind", "Introduce the new subkind name", subkind.Description, "Save", "Cancel"); Debug.WriteLine("Edited subkind name: " + result); if (!string.IsNullOrEmpty(result)) { subkind.Description = result; DbService.Upsert <Subkind>(subkind); LoadSubkinds(); } }
private async void DeleteSubkindExecute() { Debug.WriteLine("DeleteSubkindExecute"); Subkind subkind = OpenMenuFlyoutAction.HoldedObject as Subkind; if (subkind == null) { Debug.WriteLine("Invalid subkind to delete..."); return; } Debug.WriteLine("Subkind to delete: " + subkind.ToString()); bool result = await dialogService.ShowConfirmMessage("Delete subkind", "Are you sure you want to delete the subkind " + subkind.Description, "I agree", "Delete", "Cancel"); Debug.WriteLine("Delete subkind: " + result); if (result) { if (DbService.Delete <Subkind>(subkind)) { LoadSubkinds(); } } }