public AbemaProgramInfoViewModel(AbemaState abemaState, StatusService statusService) { var programHost = new ProgramHost(abemaState, statusService).AddTo(this); Title = programHost.ObserveProperty(w => w.Title).ToReadOnlyReactiveProperty().AddTo(this); Description = programHost.ObserveProperty(w => w.Description).ToReadOnlyReactiveProperty().AddTo(this); HasInfo = programHost.ObserveProperty(w => w.Title) .Select(w => !string.IsNullOrWhiteSpace(w)) .ToReadOnlyReactiveProperty().AddTo(this); Thumbnail1 = programHost.ObserveProperty(w => w.Thumbnail1).ToReadOnlyReactiveProperty().AddTo(this); Thumbnail2 = programHost.ObserveProperty(w => w.Thumbnail2).ToReadOnlyReactiveProperty().AddTo(this); AtChannel = abemaState.ObserveProperty(w => w.CurrentChannel) .Where(w => w != null) .Select(w => $"at {w.Name.Replace("チャンネル", "")}") .ToReadOnlyReactiveProperty().AddTo(this); Range = abemaState.ObserveProperty(w => w.CurrentSlot) .Where(w => w != null) .Select(w => $"{w.StartAt.ToString("t")} ~ {w.EndAt.ToString("t")}") .ToReadOnlyReactiveProperty().AddTo(this); Casts = programHost.Casts.ToReadOnlyReactiveCollection().AddTo(this); Crews = programHost.Crews.ToReadOnlyReactiveCollection().AddTo(this); }
public DisplayManager(ProgramHost host) : base(host) { UpdateFrequency = UpdateFrequency.Update100; }