public AppSettingModel() { this.Header = "Основные настройки"; this.Languages = Generic.GetEnumValues <Languages>(); this.SkinSettings = Skins.SkinSettings; var appConfig = ConfigStorage.Instance.AppConfig; this.UpdateReader = appConfig.UpdateReader; this.MinimizeToTray = appConfig.MinimizeToTray; this.Language = appConfig.Language; this.AutoUpdateHours = appConfig.AutoUpdateInHours.ToString(); this.Skin = Skins.GetSkinSetting(ConfigStorage.Instance.ViewConfig.SkinGuid); this.StartAppMinimizedToTray = appConfig.StartMinimizedToTray; this.FolderNamingStrategy = new FolderNamingModel(); using (var context = Repository.GetEntityContext()) { #warning DB connection in ctor var config = context.Get <DatabaseConfig>().Single(); this.FolderNamingStrategy.SelectedGuid = config.FolderNamingStrategy; } this.Sort = new SortModel(); var appSort = ConfigStorage.Instance.ViewConfig.LibraryFilter.SortDescription; if (appSort.PropertyName != null) { Sort.SelectedDescription = appSort; } }