aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Utilities/Tango.MachineDesigner.UI/ViewModels/MachinesViewVM.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Software/Visual_Studio/Utilities/Tango.MachineDesigner.UI/ViewModels/MachinesViewVM.cs')
-rw-r--r--Software/Visual_Studio/Utilities/Tango.MachineDesigner.UI/ViewModels/MachinesViewVM.cs41
1 files changed, 38 insertions, 3 deletions
diff --git a/Software/Visual_Studio/Utilities/Tango.MachineDesigner.UI/ViewModels/MachinesViewVM.cs b/Software/Visual_Studio/Utilities/Tango.MachineDesigner.UI/ViewModels/MachinesViewVM.cs
index 6d2cddda6..88a62dff8 100644
--- a/Software/Visual_Studio/Utilities/Tango.MachineDesigner.UI/ViewModels/MachinesViewVM.cs
+++ b/Software/Visual_Studio/Utilities/Tango.MachineDesigner.UI/ViewModels/MachinesViewVM.cs
@@ -1,18 +1,53 @@
using System;
using System.Collections.Generic;
+using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
-using Tango.MachineDesigner.UI.SupervisingController;
+using Tango.DAL.Observables;
using Tango.SharedUI;
namespace Tango.MachineDesigner.UI.ViewModels
{
- public class MachinesViewVM : ViewModel<IMachinesView>
+ public class MachinesViewVM : ViewModel
{
- public MachinesViewVM(IMachinesView view) : base(view)
+ private ObservableCollection<Machine> _machines;
+ /// <summary>
+ /// Gets or sets the machines.
+ /// </summary>
+ public ObservableCollection<Machine> Machines
{
+ get { return _machines; }
+ set { _machines = value; RaisePropertyChangedAuto(); }
+ }
+
+ private ObservableCollection<Organization> _organizations;
+ /// <summary>
+ /// Gets or sets the organizations.
+ /// </summary>
+ public ObservableCollection<Organization> Organizations
+ {
+ get { return _organizations; }
+ set { _organizations = value; RaisePropertyChangedAuto(); }
+ }
+ private Machine _selectedMachine;
+ /// <summary>
+ /// Gets or sets the selected machine.
+ /// </summary>
+ public Machine SelectedMachine
+ {
+ get { return _selectedMachine; }
+ set { _selectedMachine = value; RaisePropertyChangedAuto(); }
+ }
+
+ /// <summary>
+ /// Initializes a new instance of the <see cref="MachinesViewVM"/> class.
+ /// </summary>
+ public MachinesViewVM() : base()
+ {
+ Organizations = DBAdapter.DbContext.ORGANIZATIONS.Where(x => !x.DELETED).ToList().Select(x => new Organization(x)).ToObservableCollection();
+ Machines = DBAdapter.DbContext.MACHINES.Where(x => !x.DELETED).ToList().Select(x => new Machine(x)).ToObservableCollection();
}
}
}