コード例 #1
0
 async Task SuccessFullySaved()
 {
     ClearSelections();
     LoadGrid();
     StateHasChanged();
     await SuccessNotification.Show();
 }
コード例 #2
0
        private async void DeleteCategoryAppButton_Click(object sender, RoutedEventArgs e)
        {
            var CurrentCategory = (Categories)CategoryBox.SelectedValue;
            NotificationControl SuccessNotification;

            DeleteCategoryDialog dialog = new DeleteCategoryDialog();
            await dialog.ShowAsync();

            switch (dialog.Result)
            {
            case Results.Delete:
                //Remove all favorites in category
                GifologyDatabase.DeleteImageInCategory(CurrentCategory);
                GifologyDatabase.DeleteCategories(CurrentCategory);
                SuccessNotification = Notifications.CreateNotification("SuccessNotification", "Category Deleted", "Success", false);
                SuccessNotification.ShowHideNotification(true);
                break;

            case Results.Keep:
                //Don't delete favorites
                GifologyDatabase.MoveImageToUncategorized(CurrentCategory);
                GifologyDatabase.DeleteCategories(CurrentCategory);
                SuccessNotification = Notifications.CreateNotification("SuccessNotification", "Category Deleted", "Success", false);
                SuccessNotification.ShowHideNotification(true);
                break;

            case Results.Cancel:
                return;

            default:
                break;
            }

            LoadCategoryList(0);
        }
コード例 #3
0
        protected async Task SaveLocation()
        {
            Db.PortDetails.Add(portForm.ToPortDetails());

            await Db.SaveChangesAsync();

            locations = await Db.Locations.ToArrayAsync();

            portsGridView = locations
                            .SelectMany(p => p.Ports)
                            .Where(AreValidRecords)
                            .Select(p => PortDetailsGridView.FromPort(p))
                            .ToArray();

            portForm = new PortDetailsForm();

            await EditorPanel.HideAsync();

            await SuccessNotification.Show();
        }
コード例 #4
0
        protected async Task SaveLocation()
        {
            Db.PortDetails.Add(portForm.ToPortDetails());

            try
            {
                await Db.SaveChangesAsync();
            }
            catch (System.Exception)
            {
                await FailNotification.Show();
            }

            portsGridView = await LoadPortsViewModel();

            portForm = new PortDetailsForm();

            await EditorPanel.HideAsync();

            await SuccessNotification.Show();
        }