using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Tango.Core.Commands; using Tango.Core.DI; using Tango.FSE.Common.Connection; using Tango.FSE.Common.Diagnostics; using Tango.FSE.Common.SystemInfo; using Tango.Integration.ExternalBridge; using Tango.SharedUI; namespace Tango.FSE.UI.Panes { /// /// Represents the connected machine view model. /// /// public class ConnectedMachinePaneVM : ViewModel { [TangoInject(Mode = TangoInjectMode.WhenAvailable)] public IMachineProvider MachineProvider { get; set; } [TangoInject(Mode = TangoInjectMode.WhenAvailable)] public IDiagnosticsProvider DiagnosticsProvider { get; set; } [TangoInject(Mode = TangoInjectMode.WhenAvailable)] public ISystemInfoProvider SystemInfoProvider { get; set; } /// /// Occurs when the user chose to close the current machine connection. /// public event EventHandler DisconnectedFromMachine; /// /// Closes the machine connection. /// public RelayCommand DisconnectCommand { get; set; } /// /// Initializes a new instance of the class. /// public ConnectedMachinePaneVM() { TangoIOC.Default.Inject(this); DisconnectCommand = new RelayCommand(Disconnect); } private void Disconnect() { DisconnectedFromMachine?.Invoke(this, new EventArgs()); } } }