-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathLED.cs
39 lines (35 loc) · 954 Bytes
/
LED.cs
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
using System;
using System.Windows.Media;
using System.Windows.Shapes;
namespace MatrixGraphicsGenerator
{
public class LED
{
Ellipse ellipse;
bool enabled;
public int RowIndex { get; private set; }
public bool Enabled
{
get { return enabled; }
set
{
enabled = value;
if (enabled)
ellipse.Fill = new SolidColorBrush(Colors.Red);
else
ellipse.Fill = new SolidColorBrush(Colors.White);
}
}
public LED(MatrixBase matrixBase, Ellipse ledEllipse, int rowIndex)
{
ellipse = ledEllipse;
RowIndex = rowIndex;
Enabled = false;
ellipse.MouseLeftButtonDown += (s, e) =>
{
Enabled = !Enabled;
matrixBase.UpdateCode(RowIndex);
};
}
}
}