diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2017-12-10 19:01:05 +0200 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2017-12-10 19:01:05 +0200 |
| commit | 3fdcdac577d552bbdf6d7320c6ffb0753e810a08 (patch) | |
| tree | 55e392cea80a3539164abb1fd16c15986c92b287 /Software/Visual_Studio/Utilities/Tango.MachineDesigner.UI/ViewModels | |
| parent | 3eabdee9604ad67cdbab7ee35bdfa249402f8831 (diff) | |
| download | Tango-3fdcdac577d552bbdf6d7320c6ffb0753e810a08.tar.gz Tango-3fdcdac577d552bbdf6d7320c6ffb0753e810a08.zip | |
Started working on machine designer view models.
Added NAME field to MACHINE table.
Diffstat (limited to 'Software/Visual_Studio/Utilities/Tango.MachineDesigner.UI/ViewModels')
| -rw-r--r-- | Software/Visual_Studio/Utilities/Tango.MachineDesigner.UI/ViewModels/MachinesViewVM.cs | 41 |
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(); } } } |
