alielie
2025-11-21 3a471ae651b228231bebb3a2d438baa1d4ac0261
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
using System.Windows;
using System.Windows.Controls;
 
namespace HMI.UI
{
    public class LightBall : ContentControl
    {
        static LightBall()
        {
            DefaultStyleKeyProperty.OverrideMetadata(typeof(LightBall), new FrameworkPropertyMetadata(typeof(LightBall)));
        }
 
        public static readonly DependencyProperty ValueProperty = DependencyProperty.Register(
                            "Value",
                            typeof(bool?),
                            typeof(LightBall),
                            new FrameworkPropertyMetadata(false));
 
        public static readonly DependencyProperty SizeProperty = DependencyProperty.Register(
                            "Size",
                            typeof(double),
                            typeof(LightBall),
                            new FrameworkPropertyMetadata(12d));
 
        public double Size
        {
            get => (double)GetValue(SizeProperty);
            set
            {
                SetValue(SizeProperty, value);
            }
        }
 
        public bool? Value
        {
            get => (bool?)GetValue(ValueProperty);
            set
            {
                SetValue(ValueProperty, value);
            }
        }
    }
}