using Microsoft.AspNetCore.Components; namespace EgwCoreLib.Razor { public partial class ProgBar { #region Public Properties [Parameter] public string baseUM { get; set; } = "h"; [Parameter] public double currVal { get; set; } = 50; [Parameter] public double maxVal { get; set; } = 100; [Parameter] public double redLim { get; set; } = 10; [Parameter] public bool showAct { get; set; } = true; [Parameter] public bool showPerc { get; set; } = true; [Parameter] public bool singleLine { get; set; } = false; [Parameter] public double yelLim { get; set; } = 20; #endregion Public Properties #region Private Properties private string bgStyle { get => $"bg-{currStyle}"; } private string currStyle { get { string answ = "dark"; if (currVal <= redLim) { answ = "danger"; } else if (currVal <= yelLim) { answ = "warning"; } else { answ = "success"; } return answ; } } private int percWidh { get { int answ = percWidthNum; if (answ <= 0) { answ = 100; } return answ; } } private int percWidthNum { get => (int)(100 * currVal / maxVal); } private int redLimNum { get => (int)(100 * redLim / maxVal); } private string textStyle { get => $"text-{currStyle}"; } private string warnClass { get => currVal > 0 ? "d-none" : "text-danger"; } private int yelLimNum { get => (int)(100 * yelLim / maxVal); } #endregion Private Properties } }