using BPA.UIControl.Commons.KnownBoxes; using System.Windows; namespace BPA.UIControl { /// /// ProgressBar 帮助类 /// public static class ProgressBarHelper { /// /// 厚度 /// public static readonly DependencyProperty ThicknessProperty = DependencyProperty.RegisterAttached( "Thickness", typeof(double), typeof(ProgressBarHelper)); /// /// Sets the thickness. /// /// The element. /// The value. public static void SetThickness(DependencyObject element, double value) { element.SetValue(ThicknessProperty, value); } /// /// Gets the thickness. /// /// The element. /// A double. public static double GetThickness(DependencyObject element) { return (double)element.GetValue(ThicknessProperty); } /// /// 是否显示百分比 /// public static readonly DependencyProperty ShowPercentProperty = DependencyProperty.RegisterAttached("ShowPercent", typeof(bool), typeof(ProgressBarHelper), new PropertyMetadata(BooleanBoxes.FalseBox)); /// /// Gets the show percent. /// /// The obj. /// A bool. public static bool GetShowPercent(DependencyObject obj) { return (bool)obj.GetValue(ShowPercentProperty); } /// /// Sets the show percent. /// /// The obj. /// If true, value. public static void SetShowPercent(DependencyObject obj, bool value) { obj.SetValue(ShowPercentProperty, BooleanBoxes.Box(value)); } /// /// 不确定进度值 /// public static readonly DependencyProperty IndeterminateValueProperty = DependencyProperty.RegisterAttached("IndeterminateValue", typeof(double), typeof(ProgressBarHelper)); /// /// Gets the indeterminate value. /// /// The obj. /// A double. public static double GetIndeterminateValue(DependencyObject obj) { return (double)obj.GetValue(IndeterminateValueProperty); } /// /// Sets the indeterminate value. /// /// The obj. /// The value. public static void SetIndeterminateValue(DependencyObject obj, double value) { obj.SetValue(IndeterminateValueProperty, value); } } }