aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels
diff options
context:
space:
mode:
authorRoy Ben-Shabat <Roy@Twine-s.com>2018-07-30 11:47:03 +0300
committerRoy Ben-Shabat <Roy@Twine-s.com>2018-07-30 11:47:03 +0300
commit019bc4dca9a0655e5adf1e26d8e3f513563113db (patch)
tree34f2d5e9d80d2d12a7e7c41e31dff1fd424a8fe2 /Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels
parente9c55f4d18b0aac54e1a726ffca0c3c10d2c23ff (diff)
downloadTango-019bc4dca9a0655e5adf1e26d8e3f513563113db.tar.gz
Tango-019bc4dca9a0655e5adf1e26d8e3f513563113db.zip
Improved and optimized transport layer transporter and adapter.
Diffstat (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels')
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/ExternalBridgeViewVM.cs25
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MainViewVM.cs26
2 files changed, 47 insertions, 4 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
new file mode 100644
index 000000000..f0b6bbfdf
--- /dev/null
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/ExternalBridgeViewVM.cs
@@ -0,0 +1,25 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Tango.Core.DI;
+using Tango.PPC.Common;
+using Tango.PPC.Common.ExternalBridge;
+
+namespace Tango.PPC.UI.ViewModels
+{
+ public class ExternalBridgeViewVM : PPCViewModel
+ {
+ /// <summary>
+ /// Gets or sets the external bridge service.
+ /// </summary>
+ [TangoInject]
+ public IPPCExternalBridgeService ExternalBridgeService { get; set; }
+
+ public override void OnApplicationStarted()
+ {
+ //throw new NotImplementedException();
+ }
+ }
+}
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MainViewVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MainViewVM.cs
index faac9ad16..cf85246f8 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MainViewVM.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MainViewVM.cs
@@ -7,6 +7,7 @@ using Tango.Core.DI;
using Tango.PPC.Common;
using Tango.PPC.Common.Application;
using Tango.PPC.Common.Authentication;
+using Tango.PPC.Common.ExternalBridge;
using Tango.PPC.Common.Modules;
using Tango.PPC.Common.Navigation;
using Tango.PPC.Common.Notifications;
@@ -20,12 +21,29 @@ namespace Tango.PPC.UI.ViewModels
/// <seealso cref="Tango.PPC.Common.PPCViewModel" />
public class MainViewVM : PPCViewModel
{
- /// <summary>
- /// Called when the application has been started.
- /// </summary>
+ [TangoInject]
+ public IPPCExternalBridgeService ExternalBridgeService { get; set; }
+
public override void OnApplicationStarted()
{
-
+ ExternalBridgeService.ClientConnected += ExternalBridgeService_ClientConnected;
+ ExternalBridgeService.ClientDisconnected += ExternalBridgeService_ClientDisconnected;
+ }
+
+ private void ExternalBridgeService_ClientDisconnected(object sender, EventArgs e)
+ {
+ InvokeUI(() =>
+ {
+ NavigationManager.NavigateTo(Common.Navigation.NavigationView.HomeModule);
+ });
+ }
+
+ private void ExternalBridgeService_ClientConnected(object sender, EventArgs e)
+ {
+ InvokeUI(() =>
+ {
+ NavigationManager.NavigateTo(Common.Navigation.NavigationView.ExternalBridgeView, false);
+ });
}
}
}