aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/FSE/Tango.FSE.UI/Tiles/Machine/MachineTile.cs
blob: 45265c6366b2775e5782a2149253c179f758b31c (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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using Tango.FSE.Common;
using Tango.FSE.Common.Connection;

namespace Tango.FSE.UI.Tiles.Machine
{
    public class MachineTile : DashboardTile
    {
        private Tango.BL.Entities.Machine _machine;
        public Tango.BL.Entities.Machine Machine
        {
            get { return _machine; }
            set { _machine = value; RaisePropertyChangedAuto(); }
        }

        public MachineTile()
        {
            Name = "Machine Configuration";
            AutoContainerStyle = false;
            AutoTitleStyle = true;
            Column = 0;
            Row = 0;
            ColumnSpan = 4;
            RowSpan = 6;
        }

        public override void OnApplicationReady()
        {
            base.OnApplicationReady();

            MachineProvider.MachineConnected += MachineProvider_MachineConnected;
        }

        private void MachineProvider_MachineConnected(object sender, MachineConnectedEventArgs e)
        {
            Machine = MachineProvider.Machine;
        }

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