public void SaveState()
        {
            if (_store == null || _ignoreChanges)
            {
                return;
            }

            var storeWindowPosition = WindowPosition.FromWindow(_window);

            if (storeWindowPosition.WindowState == WindowState.Minimized && _lastWindowState.HasValue)
            {
                storeWindowPosition.WindowState = _lastWindowState.Value;
            }

            _store.WindowPositions[_windowName] = storeWindowPosition;
        }
 public static WindowPosition ToWindowPosition(this Window window)
 {
     return(WindowPosition.FromWindow(window));
 }