aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/FSE/Modules/Tango.FSE.Diagnostics/Project/Widgets/Text/TextWidget.cs
blob: 65ac33341a2ea62d60301acaca5deb01eba137d9 (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
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Media;

namespace Tango.FSE.Diagnostics.Project.Widgets.Text
{
    public class TextWidget : DiagnosticsConfigurableWidget<TextWidgetSettings>
    {
        [JsonIgnore]
        public override string DisplayName
        {
            get
            {
                return Text;
            }
        }

        private String _text;
        public String Text
        {
            get { return _text; }
            set { _text = value; RaisePropertyChangedAuto(); RaisePropertyChanged(nameof(DisplayName)); }
        }

        private Color _color;
        public Color Color
        {
            get { return _color; }
            set { _color = value; RaisePropertyChangedAuto(); }
        }

        [JsonIgnore]
        public override bool HasSettings
        {
            get
            {
                return EditMode;
            }
        }

        public TextWidget()
        {
            Color = Colors.LightGray;
            Text = "press to edit text";
        }

        public override FrameworkElement GetView()
        {
            return new TextWidgetView();
        }
    }
}