diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2017-12-24 12:59:22 +0200 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2017-12-24 12:59:22 +0200 |
| commit | 902f5d6d68ed52d92c089a65823ff49599cd3014 (patch) | |
| tree | 4dc34d4286eade21d7ae63bf118da8a37187b94f /Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MachineConnectionViewVM.cs | |
| parent | 6ceea3e717c6a365ef05c9f3bfd6ee62145a9a5e (diff) | |
| parent | 53db041e636bb3802dbe3cb911de6ef6ef41446c (diff) | |
| download | Tango-902f5d6d68ed52d92c089a65823ff49599cd3014.tar.gz Tango-902f5d6d68ed52d92c089a65823ff49599cd3014.zip | |
MERGE!
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MachineConnectionViewVM.cs')
| -rw-r--r-- | Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MachineConnectionViewVM.cs | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MachineConnectionViewVM.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MachineConnectionViewVM.cs new file mode 100644 index 000000000..b8b888e86 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/ViewModels/MachineConnectionViewVM.cs @@ -0,0 +1,55 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.Core.Commands; +using Tango.Integration.Services; +using Tango.MachineStudio.Common.Notifications; +using Tango.SharedUI; + +namespace Tango.MachineStudio.UI.ViewModels +{ + public class MachineConnectionViewVM : DialogViewVM + { + private ExternalBridgeScanner _scanner; + + public ExternalBridgeScanner Scanner + { + get { return _scanner; } + set { _scanner = value; RaisePropertyChangedAuto(); } + } + + private IExternalBridgeClient _selectedMachine; + + public IExternalBridgeClient SelectedMachine + { + get { return _selectedMachine; } + set { _selectedMachine = value; RaisePropertyChangedAuto(); InvalidateRelayCommands(); } + } + + public RelayCommand ConnectCommand { get; set; } + + public MachineConnectionViewVM(ExternalBridgeScanner scanner) + { + Scanner = scanner; + ConnectCommand = new RelayCommand(Connect,(x) => SelectedMachine != null); + Scanner.Start(); + } + + private void Connect() + { + if (SelectedMachine != null) + { + Accept(); + } + } + + public override void OnShow() + { + base.OnShow(); + + Scanner.AvailableMachines.Clear(); + } + } +} |
