From 1133972c0c51feb478aa3944fad5f374a8a2da35 Mon Sep 17 00:00:00 2001 From: Victoria Plitt Date: Tue, 18 Apr 2023 20:25:46 +0300 Subject: Added connective icons and time to bottom of menu. --- .../PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs') diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs index d16792ead..95eb22d7a 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs @@ -31,6 +31,7 @@ namespace Tango.PPC.UI.ViewModels { private JobHandler _jobHandler; private bool _resettingDevice; + private DispatcherTimer _date_timer; /// /// Gets or sets the module loader. @@ -219,6 +220,16 @@ namespace Tango.PPC.UI.ViewModels set { _cartridges = value; RaisePropertyChangedAuto(); } } + private DateTime _currentDateTime; + /// + /// Gets or sets the current date time. + /// + public DateTime CurrentDateTime + { + get { return _currentDateTime; } + set { _currentDateTime = value; RaisePropertyChangedAuto(); } + } + #endregion #region Commands @@ -306,6 +317,11 @@ namespace Tango.PPC.UI.ViewModels PowerOffCommand = new RelayCommand(PowerOffMachine, () => MachineProvider.MachineOperator.Status != MachineStatuses.Disconnected); ResetCommand = new RelayCommand(ResetMachine, () => MachineProvider.MachineOperator.Status != MachineStatuses.Disconnected); StandByCommand = new RelayCommand(StandBy, () => MachineProvider.MachineOperator.CanPrint); + + _date_timer = new DispatcherTimer(); + _date_timer.Interval = TimeSpan.FromSeconds(1); + _date_timer.Tick += _date_timer_Tick; + _date_timer.Start(); } #endregion @@ -614,6 +630,11 @@ namespace Tango.PPC.UI.ViewModels #region Event Handlers + private void _date_timer_Tick(object sender, EventArgs e) + { + CurrentDateTime = DateTime.Now; + } + /// /// Handles the PrintingStarted event of the MachineOperator. /// -- cgit v1.3.1