9525ee358e
GUI csproj enables UseWindowsForms (NotifyIcon lives in WinForms even in .NET 8). New Services/TrayIcon.cs wraps NotifyIcon with a context menu (Open / Restart service / Exit) and the embedded webhook-server icon. MainWindow creates the TrayIcon, hides itself on minimize and restores on tray double-click. Adds GlobalUsings.cs to alias the WPF defaults for types that exist in both WPF and WinForms (Application, MessageBox, TextBox, Binding, etc.) so existing code keeps compiling without per-file changes. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
16 lines
918 B
C#
16 lines
918 B
C#
// Enabling UseWindowsForms (for the system tray NotifyIcon) brings the WinForms
|
|
// namespace into scope, which conflicts with WPF for several common type names.
|
|
// Alias the most-used types to their WPF variants project-wide so existing code
|
|
// keeps compiling. Files that genuinely need a WinForms type import it explicitly
|
|
// (System.Windows.Forms.NotifyIcon etc. in Services/TrayIcon.cs).
|
|
|
|
global using Application = System.Windows.Application;
|
|
global using MessageBox = System.Windows.MessageBox;
|
|
global using Clipboard = System.Windows.Clipboard;
|
|
global using TextBox = System.Windows.Controls.TextBox;
|
|
global using RadioButton = System.Windows.Controls.RadioButton;
|
|
global using MessageBoxButton = System.Windows.MessageBoxButton;
|
|
global using MessageBoxImage = System.Windows.MessageBoxImage;
|
|
global using MessageBoxResult = System.Windows.MessageBoxResult;
|
|
global using Binding = System.Windows.Data.Binding;
|