aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/PPC/Tango.PPC.UI
diff options
context:
space:
mode:
authorRoy Ben-Shabat <Roy@Twine-s.com>2018-07-16 13:47:20 +0300
committerRoy Ben-Shabat <Roy@Twine-s.com>2018-07-16 13:47:20 +0300
commitfdfa740288568dba27877a5ef5c817be323cfbb0 (patch)
tree933ee1cb2769d43c982596f50ff8b7ec791f3be7 /Software/Visual_Studio/PPC/Tango.PPC.UI
parentd376387fa28a2091a21e2fc7193812d1f8a40ef2 (diff)
downloadTango-fdfa740288568dba27877a5ef5c817be323cfbb0.tar.gz
Tango-fdfa740288568dba27877a5ef5c817be323cfbb0.zip
Working on PPC.
Diffstat (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI')
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Navigation/DefaultNavigationManager.cs31
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Views/MainView.xaml9
2 files changed, 36 insertions, 4 deletions
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<String> _navigationHistory;
+ /// <summary>
+ /// Gets the current view model.
+ /// </summary>
+ public PPCViewModel CurrentVM
+ {
+ get { return _currentVM as PPCViewModel; }
+ }
+
private IPPCModule _currentModule;
/// <summary>
/// Gets or sets the current module.
@@ -339,5 +347,28 @@ namespace Tango.PPC.UI.Navigation
return false;
}
}
+
+ /// <summary>
+ /// Clears the navigation back history.
+ /// </summary>
+ public void ClearHistory()
+ {
+ _navigationHistory.Clear();
+ RaisePropertyChanged(nameof(CanNavigateBack));
+ }
+
+ public void ClearHistoryExcept<T>()
+ {
+ 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}">
<touch:TouchPanel.NotificationTemplate>
<DataTemplate>
<touch:TouchButton Style="{StaticResource TangoFlatButton}" Padding="0" Command="{Binding PressedCommand}">
- <Grid>
- <ContentControl Content="{Binding Converter={StaticResource NotificationItemConverter}}" />
- <touch:TouchIconButton Background="Transparent" Padding="20" Style="{StaticResource TangoRoundTouchIconButton}" Command="{Binding CloseCommand}" CommandParameter="{Binding}" HorizontalAlignment="Right" MaxHeight="60" Width="{Binding RelativeSource={RelativeSource Self},Path=ActualHeight}" Icon="Close" Foreground="White" />
- </Grid>
+ <DockPanel>
+ <touch:TouchIconButton DockPanel.Dock="Right" Background="Transparent" Padding="20" Style="{StaticResource TangoRoundTouchIconButton}" Command="{Binding CloseCommand}" CommandParameter="{Binding}" HorizontalAlignment="Right" MaxHeight="60" Width="{Binding RelativeSource={RelativeSource Self},Path=ActualHeight}" Icon="Close" Foreground="White" />
+ <ContentControl Content="{Binding Converter={StaticResource NotificationItemConverter}}"/>
+ </DockPanel>
</touch:TouchButton>
</DataTemplate>
</touch:TouchPanel.NotificationTemplate>