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);
        }
 public DBCConfigViewModel(IDbcSettingsProvider dbcSettings)
 {
     SaveAction       = Save;
     Path             = dbcSettings.GetSettings().Path;
     SkipLoading      = dbcSettings.GetSettings().SkipLoading;
     DBCVersion       = dbcSettings.GetSettings().DBCVersion;
     this.dbcSettings = dbcSettings;
 }
Ejemplo 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;
            });
        }