Exemplo n.º 1
0
        public WindowViewModel()
        {
            MinimizeCommand = new RelayCommand(() => Application.Current.MainWindow.WindowState = WindowState.Minimized);

            CloseCommand = new RelayCommand(() => Application.Current.MainWindow.Close());

            SetTTL = new RelayCommand(() =>
            {
                if (_textBoxValue > 0 && _textBoxValue < 256)
                {
                    TTLMng.SetDefaultTTL(_textBoxValue);
                    UpdateScreenTTLValue(_currentTTL);
                    OnPropertyChanged(nameof(TTLLabel));
                }
            });

            CreateShortcut = new RelayCommand(() => AppMng.CreateShortcut());

            SetSystemTTL = new RelayCommand(() =>
            {
                TTLMng.RestoreSystemTTLValue();
                UpdateScreenTTLValue(_currentTTL);
            });
        }