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); }
static void sliderOnChange(SliderConfiguration e) { kendoConsole.log("Change :: new value is: " + e.value); }
static void sliderOnSlide(SliderConfiguration e) { kendoConsole.log("Slide :: new slide value is: " + e.value); }
public SliderViewModel CreateViewModel(SliderConfiguration Configuration) { return(new(Configuration, _tuningService)); }