add IsIndeterminate property for CircleProgressBar

This commit is contained in:
NaBian committed 2020-11-11 22:22:08 +08:00
1 parent d0a303e48b
commit 5e31009dcf
3 files changed
+86 -11

No files matched your search

@@ -1,4 +1,5 @@
using System.Windows;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using HandyControl.Data;
using HandyControl.Expression.Shapes;
@@ -19,6 +20,10 @@ namespace HandyControl.Controls
public static readonly DependencyProperty TextProperty = DependencyProperty.Register(
"Text", typeof(string), typeof(CircleProgressBar), new PropertyMetadata(default(string)));
public static readonly DependencyProperty IsIndeterminateProperty =
ProgressBar.IsIndeterminateProperty.AddOwner(typeof(CircleProgressBar),
new FrameworkPropertyMetadata(ValueBoxes.FalseBox));
private Arc _indicator;
static CircleProgressBar()
@@ -47,6 +52,12 @@ namespace HandyControl.Controls
set => SetValue(ArcThicknessProperty, value);
}
public bool IsIndeterminate
{
get => (bool)GetValue(IsIndeterminateProperty);
set => SetValue(IsIndeterminateProperty, value);
}
private void SetProgressBarIndicatorAngle()
{
if (_indicator == null) return;