Beispiel #1
0
        public SliderViewModel(
            SliderConfiguration Configuration,
            IControlTuningService <SliderConfiguration> TuningService)
        {
            this.Configuration = Configuration;

            this.WhenAnyValue(x => x.UserValue,
                              x => x.Precision,
                              (v, p) => v.ToString("F" + p))
            .ToProperty(this, x => x.OutputValueString, out _outputValueString);

            Tune = ReactiveCommand.CreateFromTask(() => TuningService.Tune(this.Configuration));
            Tune.ObserveOnDispatcher()
            .BindTo(this, x => x.Configuration);

            Tune.IsExecuting
            .Select(x => !x)
            .ToProperty(this, x => x.IsEditable, out _isEditable);
        }