public UserOptionsViewModel(Options opts, Action execute)
 {
     Opts = opts;
     execute += PerformClosing;
     SaveCmd = new RelayCommand(execute);
     Title = "User Options";
 }
Пример #2
0
        private void LoadConfig()
        {
            try
            {
                Options opts = null;
                ConfigSerializer.Deserialize(ref opts, _userConfig);
                if (opts != null)
                    _options = opts;
            }
            catch (Exception e)
            {
                Trace.WriteLine(e);
            }

            _options.PropertyChanged += (sender, args) => ConnectCmd.RaiseCanExecuteChanged();
        }