123456789101112131415161718192021222324 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows;
- namespace WpfApp29
- {
- public class AppHelper
- {
- public static T? GetWindowAtType<T>() where T: Window
- {
- foreach (var unknownWindoew in App.Current.Windows)
- {
- if (unknownWindoew is T window)
- {
- return window;
- }
- }
- return null;
- }
- }
- }
|