/// <summary> /// Initializes a new instance of the <see cref="DpiAwareWindow"/> class. /// </summary> public DpiAwareWindow() { this.SourceInitialized += OnSourceInitialized; // WM_DPICHANGED is not send when window is minimized, do listen to global display setting changes SystemEvents.DisplaySettingsChanged += OnSystemEventsDisplaySettingsChanged; // try to set per-monitor dpi awareness, before the window is displayed this.isPerMonitorDpiAware = ModernUIHelper.TrySetPerMonitorDpiAware(); }
public MainWindow() { ModernUIHelper.TrySetPerMonitorDpiAware(); AppearanceManager.Current.AccentColor = Colors.Red; InitializeComponent(); _connectionString = ConfigurationManager.ConnectionStrings["ERPContext"].ConnectionString.Substring(7).Split(';')[0]; RunUpdateTitleLoop(); }