123456789101112131415161718192021222324252627282930 |
- using System.Windows;
- namespace WpfDemo
- {
- /// <summary>
- /// Interaction logic for App.xaml
- /// </summary>
- public partial class App : Application
- {
- public App()
- {
- new DemoWindow().ShowDialog();
-
- // diagnostic - remove after testing
- if (Windows.Count > 0)
- {
- var str = "";
- foreach (Window win in Windows)
- {
- str += win.Title;
- if (win.Tag is object obj)
- str += $" ({obj.GetType().Name})";
- str += "\n";
- }
- MessageBox.Show($"The following {Windows.Count} window(s) still running:\n{str}\nPress OK to copy message to clipboard.", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
- Clipboard.SetText(str);
- }
- }
- }
- }
|