From 7658a8546a9c33a76376dff3ab646f2aceaf0a01 Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Sun, 17 Jun 2018 19:06:13 +0300 Subject: Working on PPC !!! --- .../PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs | 36 +++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels') 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 99841516e..d65dfc11c 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewModels/LayoutViewVM.cs @@ -8,6 +8,7 @@ using Tango.Core.DI; using Tango.PPC.Common; using Tango.PPC.Common.Modules; using Tango.PPC.Common.Navigation; +using Tango.PPC.UI.Notifications.NotificationItems; using Tango.PPC.UI.ViewsContracts; using Tango.SharedUI; @@ -35,6 +36,16 @@ namespace Tango.PPC.UI.ViewModels set { _isMenuOpened = value; RaisePropertyChangedAuto(); } } + private bool _isNotificationsOpened; + /// + /// Gets or sets a value indicating whether to display all notifications. + /// + public bool IsNotificationsOpened + { + get { return _isNotificationsOpened; } + set { _isNotificationsOpened = value; RaisePropertyChangedAuto(); } + } + /// /// Gets or sets the module navigation command. /// @@ -50,6 +61,11 @@ namespace Tango.PPC.UI.ViewModels /// public RelayCommand HomeCommand { get; set; } + /// + /// Gets or sets the notifications area pressed command. + /// + public RelayCommand NotificationsAreaPressedCommand { get; set; } + /// /// Initializes a new instance of the class. /// @@ -58,6 +74,7 @@ namespace Tango.PPC.UI.ViewModels ModuleNavigationCommand = new RelayCommand(NavigateToModule); HomeCommand = new RelayCommand(NavigateHome); MenuOrBackCommand = new RelayCommand(OpenMenuOrNavigateBack); + NotificationsAreaPressedCommand = new RelayCommand(OpenFirstNotificationOrDisplayAll); } /// @@ -73,6 +90,8 @@ namespace Tango.PPC.UI.ViewModels { IsMenuOpened = true; } + + NotificationProvider.PushNotification(new EmptyCartridgesNotification()); } /// @@ -118,7 +137,22 @@ namespace Tango.PPC.UI.ViewModels /// public override void OnViewAttached() { - + + } + + /// + /// Opens the first notification or display all. + /// + private void OpenFirstNotificationOrDisplayAll() + { + if (NotificationProvider.NotificationItems.Count == 1) + { + //Open first + } + else + { + IsNotificationsOpened = true; + } } } } -- cgit v1.3.1