public MainWindow() { InitializeComponent(); this.Closing += OnClosing; this.SizeChanged += OnSizeChanged; this.LocationChanged += OnLocationChanged; this.SetPreferences(); this.SetWindowTitle(); this.SetWindowSize(); this.SetWindowPosition(); WindowHelper.Activate(this); }