Browse Source

avalonia: Added DeleteItems for CoreRepistory

Kenric Nugteren 2 weeks ago
parent
commit
232955767f
1 changed files with 13 additions and 0 deletions
  1. 13 0
      InABox.Avalonia/DataModels/CoreRepository.cs

+ 13 - 0
InABox.Avalonia/DataModels/CoreRepository.cs

@@ -772,6 +772,19 @@ namespace InABox.Avalonia
         {
             _table.Rows.Remove(item.Row);
             AllItems.Remove(item);
+            SaveToStorage();
+            Search();
+            NotifyChanged();
+        }
+
+        public virtual void DeleteItems(IEnumerable<TItem> items)
+        {
+            foreach(var item in items)
+            {
+                _table.Rows.Remove(item.Row);
+                AllItems.Remove(item);
+            }
+            SaveToStorage();
             Search();
             NotifyChanged();
         }