protected override void OnSourceInitialized(object sender, EventArgs e) { base.OnSourceInitialized(sender, e); if (sender is Window window) { var windowSettingsResult = m_SettingsBll.GetWindowSettings(); if (!windowSettingsResult.Succeeded) { return; } var windowSettings = windowSettingsResult.Result; if (windowSettings == null) { return; } window.Left = windowSettings.Left; window.Top = windowSettings.Top; window.Width = windowSettings.Width; window.Height = windowSettings.Height; if (windowSettings.Maximized) { window.WindowState = WindowState.Maximized; } } }