aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/FSE/Tango.FSE.UI/ViewModels/LayoutViewVM.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Software/Visual_Studio/FSE/Tango.FSE.UI/ViewModels/LayoutViewVM.cs')
-rw-r--r--Software/Visual_Studio/FSE/Tango.FSE.UI/ViewModels/LayoutViewVM.cs52
1 files changed, 52 insertions, 0 deletions
diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/ViewModels/LayoutViewVM.cs b/Software/Visual_Studio/FSE/Tango.FSE.UI/ViewModels/LayoutViewVM.cs
index 13d2baff0..6623f7aba 100644
--- a/Software/Visual_Studio/FSE/Tango.FSE.UI/ViewModels/LayoutViewVM.cs
+++ b/Software/Visual_Studio/FSE/Tango.FSE.UI/ViewModels/LayoutViewVM.cs
@@ -1,14 +1,66 @@
using System;
using System.Collections.Generic;
+using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
+using Tango.Core.Commands;
using Tango.FSE.Common;
+using Tango.FSE.UI.Panes;
+using Tango.Integration.ExternalBridge;
namespace Tango.FSE.UI.ViewModels
{
public class LayoutViewVM : FSEViewModel
{
+ private bool _isConnectionPaneOpened;
+ public bool IsConnectionPaneOpened
+ {
+ get { return _isConnectionPaneOpened; }
+ set { _isConnectionPaneOpened = value; RaisePropertyChangedAuto(); OnConnectionPaneToggleChanged(); }
+ }
+
+ private MachineConnectionPaneVM _connectionPaneVM;
+ public MachineConnectionPaneVM ConnectionPaneVM
+ {
+ get { return _connectionPaneVM; }
+ set { _connectionPaneVM = value; RaisePropertyChangedAuto(); }
+ }
+
+ private bool _isMenuOpened;
+ public bool IsMenuOpened
+ {
+ get { return _isMenuOpened; }
+ set { _isMenuOpened = value; RaisePropertyChangedAuto(); }
+ }
+
+ public RelayCommand ToggleConnectionPaneCommand { get; set; }
+
+ public LayoutViewVM()
+ {
+ ToggleConnectionPaneCommand = new RelayCommand(() => IsConnectionPaneOpened = !IsConnectionPaneOpened);
+ ConnectionPaneVM = new MachineConnectionPaneVM();
+ ConnectionPaneVM.MachineSelected += ConnectionPaneVM_MachineSelected;
+ }
+
+ private void ConnectionPaneVM_MachineSelected(object sender, IExternalBridgeClient machine)
+ {
+ IsConnectionPaneOpened = false;
+ Debug.WriteLine($"Machine selected for connection: {machine.ToString()}");
+ }
+
+ private void OnConnectionPaneToggleChanged()
+ {
+ if (IsConnectionPaneOpened)
+ {
+ ConnectionPaneVM.Start();
+ }
+ else
+ {
+ ConnectionPaneVM.Stop();
+ }
+ }
+
public override void OnApplicationStarted()
{