aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs')
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs21
1 files changed, 21 insertions, 0 deletions
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;
/// <summary>
/// Gets or sets the module loader.
@@ -219,6 +220,16 @@ namespace Tango.PPC.UI.ViewModels
set { _cartridges = value; RaisePropertyChangedAuto(); }
}
+ private DateTime _currentDateTime;
+ /// <summary>
+ /// Gets or sets the current date time.
+ /// </summary>
+ 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;
+ }
+
/// <summary>
/// Handles the PrintingStarted event of the MachineOperator.
/// </summary>