Sfoglia il codice sorgente

Added CollectionChanged event to the IListDataSource interface.

BDisp 1 anno fa
parent
commit
7be80b48f3
1 ha cambiato i file con 7 aggiunte e 0 eliminazioni
  1. 7 0
      Terminal.Gui/Views/ListView.cs

+ 7 - 0
Terminal.Gui/Views/ListView.cs

@@ -1,4 +1,6 @@
 using System.Collections;
 using System.Collections;
+using System.Collections.ObjectModel;
+using System.Collections.Specialized;
 using static Terminal.Gui.SpinnerStyle;
 using static Terminal.Gui.SpinnerStyle;
 
 
 namespace Terminal.Gui;
 namespace Terminal.Gui;
@@ -6,6 +8,11 @@ namespace Terminal.Gui;
 /// <summary>Implement <see cref="IListDataSource"/> to provide custom rendering for a <see cref="ListView"/>.</summary>
 /// <summary>Implement <see cref="IListDataSource"/> to provide custom rendering for a <see cref="ListView"/>.</summary>
 public interface IListDataSource
 public interface IListDataSource
 {
 {
+    /// <summary>
+    /// Event to raise when an item is added, removed, or moved, or the entire list is refreshed.
+    /// </summary>
+    event NotifyCollectionChangedEventHandler CollectionChanged;
+
     /// <summary>Returns the number of elements to display</summary>
     /// <summary>Returns the number of elements to display</summary>
     int Count { get; }
     int Count { get; }