From fdfa740288568dba27877a5ef5c817be323cfbb0 Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Mon, 16 Jul 2018 13:47:20 +0300 Subject: Working on PPC. --- .../Navigation/DefaultNavigationManager.cs | 31 ++++++++++++++++++++++ .../PPC/Tango.PPC.UI/Views/MainView.xaml | 9 ++++--- 2 files changed, 36 insertions(+), 4 deletions(-) (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI') diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Navigation/DefaultNavigationManager.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Navigation/DefaultNavigationManager.cs index 47450a68e..f06bd88de 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Navigation/DefaultNavigationManager.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Navigation/DefaultNavigationManager.cs @@ -34,6 +34,14 @@ namespace Tango.PPC.UI.Navigation private Stack _navigationHistory; + /// + /// Gets the current view model. + /// + public PPCViewModel CurrentVM + { + get { return _currentVM as PPCViewModel; } + } + private IPPCModule _currentModule; /// /// Gets or sets the current module. @@ -339,5 +347,28 @@ namespace Tango.PPC.UI.Navigation return false; } } + + /// + /// Clears the navigation back history. + /// + public void ClearHistory() + { + _navigationHistory.Clear(); + RaisePropertyChanged(nameof(CanNavigateBack)); + } + + public void ClearHistoryExcept() + { + var history_list = _navigationHistory.ToList(); + history_list = history_list.Where(x => x.Contains(typeof(T).Name)).Distinct().ToList(); + _navigationHistory.Clear(); + + foreach (var item in history_list) + { + _navigationHistory.Push(item); + } + + RaisePropertyChanged(nameof(CanNavigateBack)); + } } } diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MainView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MainView.xaml index f333ea2e8..1ce18bff1 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MainView.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MainView.xaml @@ -23,15 +23,16 @@ CurrentMessageBox="{Binding NotificationProvider.CurrentMessageBox}" HasNotifications="{Binding NotificationProvider.HasNotificationItems}" Notifications="{Binding NotificationProvider.NotificationItems}" + ItemExpandedPropertyPath="IsExpanded" HasDialog="{Binding NotificationProvider.HasDialog}" CurrentDialog="{Binding NotificationProvider.CurrentDialog}"> - - - - + + + + -- cgit v1.3.1