protected override async void OnNavigatedFrom(NavigationEventArgs e)
        {
            if (string.IsNullOrEmpty(this.ActionItem.Raw))
            {
                ActionItemManager.Delete(this.ActionItem);
            }
            else
            {
                // Try and save first...
                await ActionItemManager.SaveAsync();
            }

            // As you were
            base.OnNavigatedFrom(e);
            SystemNavigationManager.GetForCurrentView().BackRequested -= EditPage_BackRequested;
        }
Beispiel #2
0
        private async Task DeleteAsync()
        {
            IList <ActionItem> toBeDeleted = new List <ActionItem>();

            // We have to make a temporary list of things to delete as doing so in the loop
            // will invalidate the IEnumerable
            foreach (ActionItem actionItem in this.ActionItems.SelectedItems)
            {
                toBeDeleted.Add(actionItem);
            }

            foreach (var actionItem in toBeDeleted)
            {
                ActionItemManager.Delete(actionItem);
            }

            await ActionItemManager.SaveAsync();
        }