Ejemplo n.º 1
0
        private async void MetroWindow_Closing(object sender, CancelEventArgs e)
        {
            // allow cancelling exit to save changes
            if (!await _itemViewModel.ConfirmDiscardUnsavedChanges())
            {
                e.Cancel = true;
            }

            var uiSettings = new UISettings
            {
                Width  = Width,
                Height = Height,
                Left   = Left,
                Top    = Top
            };

            UISettings.Save(uiSettings);
        }
Ejemplo n.º 2
0
        private async void MetroWindow_Closing(object sender, CancelEventArgs e)
        {
            // allow cancelling exit to save changes
            if (!await _itemViewModel.ConfirmDiscardUnsavedChanges())
            {
                e.Cancel = true;
            }

            if (_appViewModel.UISettings == null)
            {
                _appViewModel.UISettings = new UISettings();
            }

            _appViewModel.UISettings.Width   = Width;
            _appViewModel.UISettings.Height  = Height;
            _appViewModel.UISettings.Left    = Left;
            _appViewModel.UISettings.Top     = Top;
            _appViewModel.UISettings.Scaling = _appViewModel.UIScaleFactor;

            UISettings.Save(_appViewModel.UISettings);
        }
Ejemplo n.º 3
0
        private async void MetroWindow_Closing(object sender, CancelEventArgs e)
        {
            // allow cancelling exit to save changes
            if (!await _itemViewModel.ConfirmDiscardUnsavedChanges())
            {
                e.Cancel = true;
            }

            var uiSettings = UISettings.Load();

            if (uiSettings == null)
            {
                uiSettings = new UISettings();
            }

            uiSettings.Width  = Width;
            uiSettings.Height = Height;
            uiSettings.Left   = Left;
            uiSettings.Top    = Top;

            UISettings.Save(uiSettings);
        }
Ejemplo n.º 4
0
 //Call if settings ready for apply.
 public void ChangeSettings()
 {
     Local();
     uiSettings.Save();
 }