diff options
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.cs | 36 |
1 files changed, 35 insertions, 1 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 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; + /// <summary> + /// Gets or sets a value indicating whether to display all notifications. + /// </summary> + public bool IsNotificationsOpened + { + get { return _isNotificationsOpened; } + set { _isNotificationsOpened = value; RaisePropertyChangedAuto(); } + } + /// <summary> /// Gets or sets the module navigation command. /// </summary> @@ -51,6 +62,11 @@ namespace Tango.PPC.UI.ViewModels public RelayCommand HomeCommand { get; set; } /// <summary> + /// Gets or sets the notifications area pressed command. + /// </summary> + public RelayCommand NotificationsAreaPressedCommand { get; set; } + + /// <summary> /// Initializes a new instance of the <see cref="LayoutViewVM"/> class. /// </summary> public LayoutViewVM() @@ -58,6 +74,7 @@ namespace Tango.PPC.UI.ViewModels ModuleNavigationCommand = new RelayCommand<string>(NavigateToModule); HomeCommand = new RelayCommand(NavigateHome); MenuOrBackCommand = new RelayCommand(OpenMenuOrNavigateBack); + NotificationsAreaPressedCommand = new RelayCommand(OpenFirstNotificationOrDisplayAll); } /// <summary> @@ -73,6 +90,8 @@ namespace Tango.PPC.UI.ViewModels { IsMenuOpened = true; } + + NotificationProvider.PushNotification(new EmptyCartridgesNotification()); } /// <summary> @@ -118,7 +137,22 @@ namespace Tango.PPC.UI.ViewModels /// </summary> public override void OnViewAttached() { - + + } + + /// <summary> + /// Opens the first notification or display all. + /// </summary> + private void OpenFirstNotificationOrDisplayAll() + { + if (NotificationProvider.NotificationItems.Count == 1) + { + //Open first + } + else + { + IsNotificationsOpened = true; + } } } } |
