private void SaveSettings()
        {
            var wordParserSettings = new WordSettings();

            wordParserSettings.OdstranitTeckuUSlov = _isOdstranitTeckuUSlov;
            wordParserSettings.OdstranitPocatecniAKoncoveMezery = _isOdstranitPocatecniAKoncoveMezery;
            wordParserSettings.ZahrnoutTextOdstavce             = _isZahrnoutTextOdstavce;
            wordParserSettings.ZahrnoutTextZnakovychStylu       = _isZahrnoutTextZnakovychStylu;
            var mainWindow = (MainWindow)Application.Current.MainWindow;

            ((MainWindowsViewModel)mainWindow.DataContext).UpdateWordSettings(wordParserSettings);
            ActualWindow?.Close();
        }
Ejemplo n.º 2
0
        private void RestoreWindowState()
        {
            var windowStateSettings = this.Resolve <Settings>().Get(SettingsKey, new WindowStateSettings
            {
                WindowSize            = DefaultSize,
                Location              = DefaultLocation,
                WindowStartupLocation = DefaultWindowStartupLocation,
                WindowState           = DefaultWindowState
            });

            ActualWindow.BeginInit();
            ActualWindow.Height = windowStateSettings.WindowSize.Height;
            ActualWindow.Width  = windowStateSettings.WindowSize.Width;
            ActualWindow.WindowStartupLocation = windowStateSettings.WindowStartupLocation;
            ActualWindow.WindowState           = windowStateSettings.WindowState;
            if (ActualWindow.WindowStartupLocation == WindowStartupLocation.Manual)
            {
                ActualWindow.Left = windowStateSettings.Location.X;
                ActualWindow.Top  = windowStateSettings.Location.Y;
            }
            ActualWindow.EndInit();
        }
Ejemplo n.º 3
0
 protected override void OnActualWindowChanged(Window oldWindow)
 {
     oldWindow.Do(x => x.Closing    -= OnClosing);
     ActualWindow.Do(x => x.Closing += OnClosing);
 }
 void ICurrentWindowService.Show()
 {
     ActualWindow.Do(x => x.Show());
 }
 void ICurrentWindowService.SetWindowState(WindowState state)
 {
     ActualWindow.Do(x => x.WindowState = state);
 }
 void ICurrentWindowService.Hide()
 {
     ActualWindow.Do(x => x.Hide());
 }
 void ICurrentWindowService.Activate()
 {
     ActualWindow.Do(x => x.Activate());
 }
 void ICurrentWindowService.Close()
 {
     ActualWindow.Do(x => x.Close());
 }