diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-11-12 17:24:59 +0200 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-11-12 17:24:59 +0200 |
| commit | 529d8938db258e7162b7776a5b5180a9675a7f70 (patch) | |
| tree | 2c8df0162269a60a8532085c1dc97b70fdd0d469 /Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MainViewVM.cs | |
| parent | a98e30ab93fd4717bbe49c0b2cb6dff4bc65a67c (diff) | |
| download | Tango-529d8938db258e7162b7776a5b5180a9675a7f70.tar.gz Tango-529d8938db258e7162b7776a5b5180a9675a7f70.zip | |
Some improvements to PPC.
Diffstat (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MainViewVM.cs')
| -rw-r--r-- | Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MainViewVM.cs | 35 |
1 files changed, 35 insertions, 0 deletions
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 e207c30b3..b01be3734 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MainViewVM.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; +using System.Windows.Threading; using Tango.Core.DI; using Tango.Integration.ExternalBridge; using Tango.PPC.Common; @@ -22,11 +23,45 @@ namespace Tango.PPC.UI.ViewModels /// <seealso cref="Tango.PPC.Common.PPCViewModel" /> public class MainViewVM : PPCViewModel { + private DispatcherTimer _date_timer; + + private DateTime _currentDateTime; + /// <summary> + /// Gets or sets the current date time. + /// </summary> + public DateTime CurrentDateTime + { + get { return _currentDateTime; } + set { _currentDateTime = value; RaisePropertyChangedAuto(); } + } + + public MainViewVM() + { + _date_timer = new DispatcherTimer(); + _date_timer.Interval = TimeSpan.FromSeconds(1); + _date_timer.Tick += _date_timer_Tick; + _date_timer.Start(); + } + /// <summary> /// Called when the application has been started. /// </summary> public override void OnApplicationStarted() { } + + #region Event Handlers + + /// <summary> + /// Handles the Tick event of the _date_timer. + /// </summary> + /// <param name="sender">The source of the event.</param> + /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param> + private void _date_timer_Tick(object sender, EventArgs e) + { + CurrentDateTime = DateTime.Now; + } + + #endregion } } |
