public static void Initialize(IntPtr handle) { if (Instance != null) { throw new InvalidOperationException("WindowCollection already initialized."); } WindowCollection windowCollection = new WindowCollection(handle); _instance = windowCollection; }
void MainWindowLoaded(object sender, RoutedEventArgs e) { IntPtr intPtr = new WindowInteropHelper(this).Handle; WindowCollection.Initialize(intPtr); }