Ejemplo n.º 1
0
        public DetailViewModel(DetailModel _model)
        {
            Model = _model.AddTo(DisposeCollection);

            InputTitle   = Model.ShownTask.Select(t => t?.TitleString ?? "").ToReactiveProperty("", ReactivePropertyMode.DistinctUntilChanged).AddTo(DisposeCollection);
            InputExplain = Model.ShownTask.Select(t => t?.ExplainString ?? "").ToReactiveProperty("", ReactivePropertyMode.DistinctUntilChanged).AddTo(DisposeCollection);
            InputStatus  = Model.ShownTask.Select(t => t?.Status ?? Status.Ready).ToReactiveProperty(Status.Ready, ReactivePropertyMode.DistinctUntilChanged).AddTo(DisposeCollection);

            InputTitle.Where(s => (Model.ShownTask.Value?.Title ?? null) != Domain.Title.Create(s)).Subscribe(s => Model.Save(Domain.Title.Create(s))).AddTo(DisposeCollection);
            InputExplain.Where(s => (Model.ShownTask.Value?.Explain ?? null) != Domain.Explain.Create(s)).Subscribe(s => Model.Save(Domain.Explain.Create(s))).AddTo(DisposeCollection);
            InputStatus.Where(s => (Model.ShownTask.Value?.Status ?? null) != s).Subscribe(s => Model.Save(s)).AddTo(DisposeCollection);
        }
Ejemplo n.º 2
0
 void Title(string title)
 {
     InputTitle.Clear();
     InputTitle.SendKeys(title);
 }