void Context_RemoveCollection(object sender, RoutedEventArgs e) { CollectionEditor collection = grdCollections.SelectedItem as CollectionEditor; if (collection == null) { return; } module.RemoveCollection(collection.Name); }
void OnEditCollectionItemChanged(CollectionEditor collection, string property) { switch (property) { case "Name": if (string.IsNullOrEmpty(collection.OldName)) { module.CreateCollection(collection.Name, collection.Description, collection.ItemsPerUser); } else { module.ChangeCollection(collection.OldName, collection.Name, collection.Description, collection.ItemsPerUser); } selectedcollection = collection.Name; items.Foreach(i => i.Collection = collection.Name); blockeditems.Foreach(i => i.Collection = collection.Name); break; default: module.ChangeCollection(collection.OldName, collection.Name, collection.Description, collection.ItemsPerUser); break; } collection.Apply(); }