usingSystem;usingSystem.Collections.Generic;usingSystem.Linq;publicclassObservableList<T>:List<T>{
// Event to notify when the list changespubliceventAction OnListChanged;publiceventAction<T> OnItemChanged;publicnewvoidAdd(T item){
base.Add(item);NotifyListChanged();}publicnewvoidRemove(T item){
base.Remove(item);NotifyListChanged();}// Add other list modification methods as neededprivatevoidNotifyListChanged(){
OnListChanged?.Invoke();