using System.Numerics; using Microsoft.AspNetCore.Components; namespace AIStudio.Components.Blocks; public partial class ConfigurationSlider : ConfigurationBase where T : struct, INumber { /// /// The minimum value for the slider. /// [Parameter] public T Min { get; set; } = T.Zero; /// /// The maximum value for the slider. /// [Parameter] public T Max { get; set; } = T.One; /// /// The step size for the slider. /// [Parameter] public T Step { get; set; } = T.One; /// /// The unit to display next to the slider's value. /// [Parameter] public string Unit { get; set; } = string.Empty; /// /// The value used for the slider. /// [Parameter] public Func Value { get; set; } = () => T.Zero; /// /// An action which is called when the option is changed. /// [Parameter] public Action ValueUpdate { get; set; } = _ => { }; private async Task OptionChanged(T updatedValue) { this.ValueUpdate(updatedValue); await this.SettingsManager.StoreSettings(); await this.InformAboutChange(); } }