Beispiel #1
0
        /// <summary>
        /// Send request to the DataProvider to delete the item.
        /// </summary>
        public async Task DeleteAsync()
        {
            if (DataProvider != null && Item != null)
            {
                var response = await DataProvider.DeleteAsync(Item, CancellationToken.None).ConfigureAwait(true);

                if (response.Success)
                {
                    Mode = HideForm ? FormModes.Hidden : FormModes.Create;
                    await Deleted.InvokeAsync(Item).ConfigureAwait(true);
                }
                else
                {
                    await Error.InvokeAsync(response.ErrorMessage).ConfigureAwait(true);
                }
            }
        }