diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-07-31 13:23:54 +0300 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-07-31 13:23:54 +0300 |
| commit | a56427605302770b4c0a71a5ff4da439300a2250 (patch) | |
| tree | 176317dcfc861c4c82777dfdd916a83ae1dfd0f2 /Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/ExternalBridgeViewVM.cs | |
| parent | c728eba7cf217972c47e0a65afcb1975f6d6f6f1 (diff) | |
| download | Tango-a56427605302770b4c0a71a5ff4da439300a2250.tar.gz Tango-a56427605302770b4c0a71a5ff4da439300a2250.zip | |
Working on External bridge !
Diffstat (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/ExternalBridgeViewVM.cs')
| -rw-r--r-- | Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/ExternalBridgeViewVM.cs | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/ExternalBridgeViewVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/ExternalBridgeViewVM.cs index 3c348c796..a5a8d9ac3 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/ExternalBridgeViewVM.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/ExternalBridgeViewVM.cs @@ -16,6 +16,8 @@ namespace Tango.PPC.UI.ViewModels [TangoCreateWhenRegistered] public class ExternalBridgeViewVM : PPCViewModel { + private bool _disconnecting; + private ExternalBridgeClientConnectedEventArgs _connection; public ExternalBridgeClientConnectedEventArgs Connection { @@ -34,17 +36,27 @@ namespace Tango.PPC.UI.ViewModels public ExternalBridgeViewVM() { - CloseSessionCommand = new RelayCommand(CloseSession); + CloseSessionCommand = new RelayCommand(CloseSession,() => !_disconnecting); } private void CloseSession() { + _disconnecting = true; + InvalidateRelayCommands(); ExternalBridgeService.DisconnectSession(); } + public override void OnNavigatedTo() + { + base.OnNavigatedTo(); + + _disconnecting = false; + InvalidateRelayCommands(); + } + public override void OnApplicationStarted() { - ExternalBridgeService.ClientConnected += ExternalBridgeService_ClientConnected; + ExternalBridgeService.ConnectionRequest += ExternalBridgeService_ClientConnected; ExternalBridgeService.ClientDisconnected += ExternalBridgeService_ClientDisconnected; } |
