コード例 #1
0
		public InformationWindowViewModel(MainWindowViewModelBase owner) : this(false)
		{
			// 別のメイン ウィンドウがいて、その分割ウィンドウとして表示されるケース
			// メイン ウィンドウ側の Content と同じものを表示する

			// ReSharper disable once DoNotCallOverridableMethodsInConstructor
			owner.Subscribe(nameof(this.Content), () => this.Content = owner.Content).AddTo(this);

			this.taskbarProgress = new TaskbarProgress().AddTo(this);
			this.taskbarProgress
				.Subscribe(nameof(TaskbarProgress.Updated), () => this.UpdateTaskbar())
				.AddTo(this);
		}
コード例 #2
0
		public KanColleWindowViewModel(bool isMainWindow) : base(isMainWindow)
		{
			this.Settings = SettingsHost.Instance<KanColleWindowSettings>();
			this.Settings.Dock.Subscribe(x => this.BrowserDock = x.Reverse()).AddTo(this);
			this.Settings.Dock.Subscribe(x => this.ToolAreaMaxWidth = this.GetToolAreaWidth(x)).AddTo(this);
			this.Settings.IsSplit.Subscribe(this.SplitWindow).AddTo(this);

			this.Navigator = new NavigatorViewModel().AddTo(this);
			this.Volume = new VolumeViewModel().AddTo(this);

			this.ZoomFactor = new BrowserZoomFactor { Current = GeneralSettings.BrowserZoomFactor };
			this.ZoomFactor
				.Subscribe(nameof(this.ZoomFactor.Current), () => GeneralSettings.BrowserZoomFactor.Value = this.ZoomFactor.Current)
				.AddTo(this);

			GeneralSettings.BrowserZoomFactor.Subscribe(x => this.ZoomFactor.Current = x).AddTo(this);

			this.taskbarProgress = new TaskbarProgress().AddTo(this);
			this.taskbarProgress
				.Subscribe(nameof(TaskbarProgress.Updated), () => this.UpdateTaskbar())
				.AddTo(this);
		}