aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.MachineDesigner/ViewModels/MainViewVM.cs
blob: 120ae7972ad6cffeec2a563f3162058f879d9017 (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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Tango.DAL.Observables;
using Tango.SharedUI;

namespace Tango.MachineStudio.MachineDesigner.ViewModels
{
    public class MainViewVM : ViewModel
    {
        private ObservablesEntitiesAdapter _adapter;
        /// <summary>
        /// Gets or sets the db adapter.
        /// </summary>
        public ObservablesEntitiesAdapter Adapter
        {
            get { return _adapter; }
            set { _adapter = value; RaisePropertyChangedAuto(); }
        }

        private Machine _machine;
        /// <summary>
        /// Gets or sets the machine.
        /// </summary>
        public Machine Machine
        {
            get { return _machine; }
            set { _machine = value; RaisePropertyChangedAuto(); }
        }

        private Configuration _configuration;
        /// <summary>
        /// Gets or sets the configuration.
        /// </summary>
        public Configuration Configuration
        {
            get { return _configuration; }
            set { _configuration = value; RaisePropertyChangedAuto(); }
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="MainViewVM"/> class.
        /// </summary>
        public MainViewVM()
        {
            Adapter = ObservablesEntitiesAdapter.Instance;
            Machine = Adapter.Machines.First();
            Configuration = Machine.Configuration;
        }
    }
}