private void Save()
 {
     dbcSettings.UpdateSettings(new Data.DBCSettings()
     {
         Path = Path, SkipLoading = SkipLoading, DBCVersion = DBCVersion
     });
 }
        public DBCConfigViewModel(IDbcSettingsProvider dbcSettings, IWindowManager windowManager)
        {
            path        = dbcSettings.GetSettings().Path;
            skipLoading = dbcSettings.GetSettings().SkipLoading;
            dbcVersion  = dbcSettings.GetSettings().DBCVersion;
            dbcLocale   = dbcSettings.GetSettings().DBCLocale;

            PickFolder = new DelegateCommand(async() =>
            {
                var selectedPath = await windowManager.ShowFolderPickerDialog(Path);
                if (selectedPath != null)
                {
                    Path = selectedPath;
                }
            });
            Save = new DelegateCommand(() =>
            {
                dbcSettings.UpdateSettings(new DBCSettings {
                    Path = Path, SkipLoading = SkipLoading, DBCVersion = DBCVersion, DBCLocale = DBCLocale
                });
                IsModified = false;
            });

            DBCVersions = new ObservableCollection <DBCVersions>(Enum.GetValues <DBCVersions>());
            DBCLocales  = new ObservableCollection <DBCLocales>(Enum.GetValues <DBCLocales>());

            Watch(() => DBCVersion, () => CanPickLocale);
        }
Exemplo n.º 3
0
        public DBCConfigViewModel(IDbcSettingsProvider dbcSettings)
        {
            path        = dbcSettings.GetSettings().Path;
            skipLoading = dbcSettings.GetSettings().SkipLoading;
            dbcVersion  = dbcSettings.GetSettings().DBCVersion;

            Save = new DelegateCommand(() =>
            {
                dbcSettings.UpdateSettings(new DBCSettings {
                    Path = Path, SkipLoading = SkipLoading, DBCVersion = DBCVersion
                });
                IsModified = false;
            });
        }