aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/SideChains/MaterialDesignInXamlToolkit-master/MaterialDesignThemes.Wpf/ButtonProgressAssist.cs
blob: 199589f438eb72cc32c5a465783e5a304172352b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;

namespace MaterialDesignThemes.Wpf
{
    public static class ButtonProgressAssist
    {
        public static readonly DependencyProperty MinimumProperty = DependencyProperty.RegisterAttached(
            "Minimum", typeof(double), typeof(ButtonProgressAssist), new FrameworkPropertyMetadata(default(double)));

        public static void SetMinimum(DependencyObject element, double value)
        {
            element.SetValue(MinimumProperty, value);
        }

        public static double GetMinimum(DependencyObject element)
        {
            return (double)element.GetValue(MinimumProperty);
        }

        public static readonly DependencyProperty MaximumProperty = DependencyProperty.RegisterAttached(
            "Maximum", typeof(double), typeof(ButtonProgressAssist), new FrameworkPropertyMetadata(100.0));

        public static void SetMaximum(DependencyObject element, double value)
        {
            element.SetValue(MaximumProperty, value);
        }

        public static double GetMaximum(DependencyObject element)
        {
            return (double)element.GetValue(MaximumProperty);
        }

        public static readonly DependencyProperty ValueProperty = DependencyProperty.RegisterAttached(
            "Value", typeof(double), typeof(ButtonProgressAssist), new FrameworkPropertyMetadata(default(double)));

        public static void SetValue(DependencyObject element, double value)
        {
            element.SetValue(ValueProperty, value);
        }

        public static double GetValue(DependencyObject element)
        {
            return (double)element.GetValue(ValueProperty);
        }

        public static readonly DependencyProperty IsIndeterminateProperty = DependencyProperty.RegisterAttached(
            "IsIndeterminate", typeof(bool), typeof(ButtonProgressAssist), new FrameworkPropertyMetadata(default(bool)));

        public static void SetIsIndeterminate(DependencyObject element, bool isIndeterminate)
        {
            element.SetValue(IsIndeterminateProperty, isIndeterminate);
        }

        public static bool GetIsIndeterminate(DependencyObject element)
        {
            return (bool)element.GetValue(IndicatorForegroundProperty);
        }

        public static readonly DependencyProperty IndicatorForegroundProperty = DependencyProperty.RegisterAttached(
            "IndicatorForeground", typeof(Brush), typeof(ButtonProgressAssist), new FrameworkPropertyMetadata(default(Brush)));

        public static void SetIndicatorForeground(DependencyObject element, Brush indicatorForeground)
        {
            element.SetValue(IndicatorForegroundProperty, indicatorForeground);
        }

        public static Brush GetIndicatorForeground(DependencyObject element)
        {
            return (Brush)element.GetValue(IndicatorForegroundProperty);
        }

        public static readonly DependencyProperty IndicatorBackgroundProperty = DependencyProperty.RegisterAttached(
            "IndicatorBackground", typeof(Brush), typeof(ButtonProgressAssist), new FrameworkPropertyMetadata(default(Brush)));

        public static void SetIndicatorBackground(DependencyObject element, Brush indicatorBackground)
        {
            element.SetValue(IndicatorBackgroundProperty, indicatorBackground);
        }

        public static Brush GetIndicatorBackground(DependencyObject element)
        {
            return (Brush)element.GetValue(IndicatorForegroundProperty);
        }

        public static readonly DependencyProperty IsIndicatorVisibleProperty = DependencyProperty.RegisterAttached(
            "IsIndicatorVisible", typeof(bool), typeof(ButtonProgressAssist), new FrameworkPropertyMetadata(default(bool)));

        public static void SetIsIndicatorVisible(DependencyObject element, bool isIndicatorVisible)
        {
            element.SetValue(IsIndicatorVisibleProperty, isIndicatorVisible);
        }

        public static bool GetIsIndicatorVisible(DependencyObject element)
        {
            return (bool)element.GetValue(IndicatorForegroundProperty);
        }
    }
}