private SettingsViewModel() { this.ScreenshotSettings = new ScreenshotSettingsViewModel().AddTo(this); this.WindowSettings = new WindowSettingsViewModel().AddTo(this); this.NetworkSettings = new NetworkSettingsViewModel().AddTo(this); this.UserStyleSheetSettings = new UserStyleSheetSettingsViewModel().AddTo(this); this.BrowserZoomFactor = new BrowserZoomFactor { Current = GeneralSettings.BrowserZoomFactor }; this.BrowserZoomFactor .Subscribe(nameof(this.BrowserZoomFactor.Current), () => GeneralSettings.BrowserZoomFactor.Value = this.BrowserZoomFactor.Current) .AddTo(this); GeneralSettings.BrowserZoomFactor.Subscribe(x => this.BrowserZoomFactor.Current = x).AddTo(this); this.Cultures = new[] { new CultureViewModel { DisplayName = "(auto)" } } .Concat(ResourceService.Current.SupportedCultures .Select(x => new CultureViewModel { DisplayName = x.EnglishName, Name = x.Name }) .OrderBy(x => x.DisplayName)) .ToList(); this.Libraries = ProductInfo.Libraries.Aggregate( new List <BindableTextViewModel>(), (list, lib) => { list.Add(new BindableTextViewModel { Text = list.Count == 0 ? "Built with " : ", " }); list.Add(new HyperlinkViewModel { Text = lib.Name.Replace(' ', Convert.ToChar(160)), Uri = lib.Url }); // ☝プロダクト名の途中で改行されないように、space を non-break space に置き換えてあげてるんだからねっっ return(list); }); this.ViewRangeSettingsCollection = ViewRangeCalcLogic.Logics.ToList(); this.SelectedViewRangeCalcType = this.ViewRangeSettingsCollection .FirstOrDefault(x => x.Id == KanColleSettings.ViewRangeCalcType) ?? this.ViewRangeSettingsCollection.First(); this.CompositeDisposable.Add(new PropertyChangedEventListener(KanColleClient.Current.Translations) { (sender, args) => this.RaisePropertyChanged(args.PropertyName), }); this.LoadedPlugins = new List <PluginViewModel>( PluginService.Current.Plugins.Select(x => new PluginViewModel(x))); this.FailedPlugins = new List <LoadFailedPluginViewModel>( PluginService.Current.FailedPlugins.Select(x => new LoadFailedPluginViewModel(x))); }
public ViewRangeSettingsViewModel(ICalcViewRange logic) { this.Logic = logic; this.selected = Settings.Current.KanColleClientSettings.ViewRangeCalcType == logic.Id; this.CompositeDisposable.Add(new PropertyChangedEventListener(ResourceService.Current) { (sender, args) => { this.RaisePropertyChanged("Logic"); }, }); }
public ViewRangeSettingsViewModel(ICalcViewRange logic) { this.Logic = logic; this.selected = KanColleSettings.ViewRangeCalcType == logic.Id; }
public SettingsViewModel() { if (Helper.IsInDesignMode) { return; } this.FlashQualityList = this.FlashQualities.ToList(); this.FlashWindowList = this.FlashWindows.ToList(); this.BrowserVerticalPositionList = this.BrowserVerticalPositions.ToList(); this.BrowserHorizontalPositionList = this.BrowserHorizontalPositions.ToList(); this.Libraries = App.ProductInfo.Libraries.Aggregate( new List <BindableTextViewModel>(), (list, lib) => { list.Add(new BindableTextViewModel { Text = list.Count == 0 ? "Build with " : ", " }); list.Add(new HyperlinkViewModel { Text = lib.Name.Replace(' ', Convert.ToChar(160)), Uri = lib.Url }); // プロダクト名の途中で改行されないように、space を non-break space に置き換えてあげてるんだからねっっ return(list); }); this.Cultures = new[] { new CultureViewModel { DisplayName = "(auto)" } } .Concat(ResourceService.Current.SupportedCultures .Select(x => new CultureViewModel { DisplayName = x.EnglishName, Name = x.Name }) .OrderBy(x => x.DisplayName)) .ToList(); this.CompositeDisposable.Add(new PropertyChangedEventListener(Settings.Current) { (sender, args) => this.RaisePropertyChanged(args.PropertyName), }); this._IsDarkTheme = ThemeService.Current.Theme == Theme.Dark; this._IsLightTheme = ThemeService.Current.Theme == Theme.Light; var zoomFactor = new BrowserZoomFactor { Current = Settings.Current.BrowserZoomFactor }; this.CompositeDisposable.Add(new PropertyChangedEventListener(zoomFactor) { { "Current", (sender, args) => Settings.Current.BrowserZoomFactor = zoomFactor.Current }, }); this.BrowserZoomFactor = zoomFactor; var orientationMode = new WindowOrientaionMode { CurrentMode = Settings.Current.OrientationMode }; orientationMode.Refresh(); this.CompositeDisposable.Add(orientationMode); this.CompositeDisposable.Add(new PropertyChangedEventListener(orientationMode) { { "CurrentMode", (sender, args) => Settings.Current.OrientationMode = orientationMode.CurrentMode }, }); Settings.Current.Orientation = orientationMode; this.CompositeDisposable.Add(new PropertyChangedEventListener(KanColleClient.Current.Translations) { (sender, args) => this.RaisePropertyChanged(args.PropertyName), }); if (Settings.Current.EnableUpdateNotification) { this.CheckForUpdates(); } this.ViewRangeSettingsCollection = ViewRangeCalcLogic.Logics.ToList(); this.SelectedViewRangeCalcType = this.ViewRangeSettingsCollection .FirstOrDefault(x => x.Id == Settings.Current.KanColleClientSettings.ViewRangeCalcType) ?? this.ViewRangeSettingsCollection.First(); this.ReloadPlugins(); }
public ViewRangeSettingsViewModel(ICalcViewRange logic) { this.Logic = logic; this.selected = Settings.Current.KanColleClientSettings.ViewRangeCalcType == logic.Id; }
private SettingsViewModel() { this.ScreenshotSettings = new ScreenshotSettingsViewModel().AddTo(this); this.WindowSettings = new WindowSettingsViewModel().AddTo(this); this.NetworkSettings = new NetworkSettingsViewModel().AddTo(this); this.UserStyleSheetSettings = new UserStyleSheetSettingsViewModel().AddTo(this); this.BrowserZoomFactor = new BrowserZoomFactor { Current = GeneralSettings.BrowserZoomFactor }; this.BrowserZoomFactor .Subscribe(nameof(this.BrowserZoomFactor.Current), () => GeneralSettings.BrowserZoomFactor.Value = this.BrowserZoomFactor.Current) .AddTo(this); GeneralSettings.BrowserZoomFactor.Subscribe(x => this.BrowserZoomFactor.Current = x).AddTo(this); this.Cultures = new[] { new CultureViewModel { DisplayName = "(auto)" } } .Concat(ResourceService.Current.SupportedCultures .Select(x => new CultureViewModel { DisplayName = x.EnglishName, Name = x.Name }) .OrderBy(x => x.DisplayName)) .ToList(); this.Libraries = ProductInfo.Libraries.Aggregate( new List<BindableTextViewModel>(), (list, lib) => { list.Add(new BindableTextViewModel { Text = list.Count == 0 ? "Build with " : ", " }); list.Add(new HyperlinkViewModel { Text = lib.Name.Replace(' ', Convert.ToChar(160)), Uri = lib.Url }); // ☝プロダクト名の途中で改行されないように、space を non-break space に置き換えてあげてるんだからねっっ return list; }); this.ViewRangeSettingsCollection = ViewRangeCalcLogic.Logics.ToList(); this.SelectedViewRangeCalcType = this.ViewRangeSettingsCollection .FirstOrDefault(x => x.Id == KanColleSettings.ViewRangeCalcType) ?? this.ViewRangeSettingsCollection.First(); this.LoadedPlugins = new List<PluginViewModel>( PluginService.Current.Plugins.Select(x => new PluginViewModel(x))); this.FailedPlugins = new List<LoadFailedPluginViewModel>( PluginService.Current.FailedPlugins.Select(x => new LoadFailedPluginViewModel(x))); }