private void BtnAddCollection_Click(object sender, RoutedEventArgs e) { var addCollectionControl = new AddCollectionControl(); FrontDialogOverlay.ShowContent(addCollectionControl, DialogOptionFactory.AddCollectionOptions, (obj, args) => { _appDbOperator.AddCollection(addCollectionControl.CollectionName.Text); UpdateCollections(); }); }
private void BtnAddCollection_Click(object sender, RoutedEventArgs e) { var addCollectionControl = new AddCollectionControl(); FrontDialogOverlay.ShowContent(addCollectionControl, DialogOptionFactory.AddCollectionOptions, async(obj, args) => { await using var dbContext = new ApplicationDbContext(); await dbContext.AddCollection(addCollectionControl.CollectionName.Text); //todo: exists await UpdateCollections(); }); }