SearchIconList.cs 973 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. using System.Collections.ObjectModel;
  2. using System.ComponentModel;
  3. namespace GeekDesk.ViewModel.Temp
  4. {
  5. public class SearchIconList
  6. {
  7. private static ObservableCollection<IconInfo> iconList = new ObservableCollection<IconInfo>();
  8. public static ObservableCollection<IconInfo> IconList
  9. {
  10. get
  11. {
  12. return iconList;
  13. }
  14. set
  15. {
  16. iconList = value;
  17. OnPropertyChanged("IconList");
  18. }
  19. }
  20. public static void RemoveAll()
  21. {
  22. while (IconList.Count > 0)
  23. {
  24. IconList.RemoveAt(IconList.Count - 1);
  25. }
  26. }
  27. private static event PropertyChangedEventHandler PropertyChanged;
  28. private static void OnPropertyChanged(string propertyName)
  29. {
  30. PropertyChanged?.Invoke(null, new PropertyChangedEventArgs(propertyName));
  31. }
  32. }
  33. }