aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels
diff options
context:
space:
mode:
authorShlomo Hecht <shlomo@twine-s.com>2018-11-25 10:44:37 +0200
committerShlomo Hecht <shlomo@twine-s.com>2018-11-25 10:44:37 +0200
commitbeff6af103bb0ae9b9147a907c6567bdb33abd00 (patch)
tree375eefd654c25f3b68c0cf5b3612df844a140d8e /Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels
parent57f20269fbb4c591aa73c9f5e50118310cc4892e (diff)
parentdff24e56a8906b8c9b355cf407f25f4b793beafe (diff)
downloadTango-beff6af103bb0ae9b9147a907c6567bdb33abd00.tar.gz
Tango-beff6af103bb0ae9b9147a907c6567bdb33abd00.zip
merge
Diffstat (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels')
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs13
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/MainViewVM.cs35
2 files changed, 48 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 fd36d0d13..76eda9ac0 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.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.Commands;
using Tango.Core.DI;
using Tango.Integration.Operation;
@@ -88,6 +89,11 @@ namespace Tango.PPC.UI.ViewModels
/// Gets or sets the update command.
/// </summary>
public RelayCommand UpdateCommand { get; set; }
+
+ /// <summary>
+ /// Gets or sets the storage command.
+ /// </summary>
+ public RelayCommand StorageCommand { get; set; }
#endregion
#region Constructors
@@ -108,6 +114,13 @@ namespace Tango.PPC.UI.ViewModels
{
NavigationManager.NavigateTo(NavigationView.MachineUpdateView);
TangoIOC.Default.GetInstance<MachineUpdateViewVM>().CheckForUpdates();
+ IsMenuOpened = false;
+ });
+
+ StorageCommand = new RelayCommand(() =>
+ {
+ NavigationManager.NavigateTo(NavigationView.StorageView);
+ IsMenuOpened = false;
});
}
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
}
}