コード例 #1
0
 public PreferencesWindowViewModel(GameConfigurationSection configurationSection)
 {
     _configurationSection = configurationSection;
     WhiteListedFiles      = new ObservableCollection <WhitelistedFileEditableObject>(configurationSection.WhiteListedFiles.Select(v => new WhitelistedFileEditableObject(v)));
     BasePath       = configurationSection.BasePath;
     SelectBasePath = ReactiveCommand.Create(DoSelectBasePath);
     Ok             = ReactiveCommand.Create(DoSave, _canSave);
     Cancel         = ReactiveCommand.Create(() => ShouldClose?.Invoke(this, false));
     ValidatePreferences();
 }
コード例 #2
0
 private void DoSave()
 {
     _configurationSection.BasePath = BasePath;
     _configurationSection.WhiteListedFilesConfigSection.Clear();
     foreach (var file in WhiteListedFiles)
     {
         _configurationSection.WhiteListedFilesConfigSection.Add(file.Value);
     }
     ShouldClose?.Invoke(this, true);
 }
コード例 #3
0
 public NameConfirmVM(string name)
 {
     Ok     = ReactiveCommand.Create(() => ShouldClose?.Invoke(this, true), _canSave);
     Cancel = ReactiveCommand.Create(() => ShouldClose?.Invoke(this, false));
     Name   = name;
 }