Helper.cs 498 B

123456789101112131415161718192021222324
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using System.Windows;
  7. namespace Task1.ViewModel
  8. {
  9. class Helper
  10. {
  11. private static TaskContext context;
  12. public static void CloseWindowsAtType<T>()
  13. {
  14. foreach(var t in App.Current.Windows)
  15. {
  16. if(t is T)
  17. {
  18. ((Window)t).Close();
  19. }
  20. }
  21. }
  22. }
  23. }