NavigationCommands.NavigateJournal Property
Gets the value that represents the Navigate Journal command.
Assembly: PresentationCore (in PresentationCore.dll)
XMLNS for XAML: http://schemas.microsoft.com/winfx/2006/xaml/presentation, http://schemas.microsoft.com/netfx/2007/xaml/presentation
<object property="NavigationCommands.NavigateJournal"/>
Property Value
Type: System.Windows.Input.RoutedUICommandThe routed UI command.
Default Values | |
|---|---|
Key Gesture | N/A |
UI Text | Navigation Journal |
This command indicates the intention to navigate the journal.
Frame and NavigationWindow implement support for responding to the NavigateJournal command, although you are not required to use it; in many cases the implementation in response to that command is the responsibility of the application writer.
The following example shows how to use NavigateJournal in conjunction with a Frame. The Frame provides an implementation that responds to the NavigateJournal command by navigating to the specified journal entry on either the forward or back stacks of the Frame. The journal entries are provided by the JournalEntryUnifiedViewConverter to the top-level Navigate Journal MenuItem. Each journal entry is bound to a child MenuItem that uses the NavigateJournal command.
<Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> <Window.Resources> <!-- For NavigationCommands.NavigateJournal --> <JournalEntryUnifiedViewConverter x:Key="JournalEntryUnifiedViewConverter" /> <!--Create a DataTemplate to display the navigation history--> <DataTemplate x:Key="journalMenuItemTemplate"> <TextBlock> <TextBlock Text="{Binding (JournalEntryUnifiedViewConverter.JournalEntryPosition)}" /> <TextBlock FontWeight="Bold" FontStyle="Italic"> <TextBlock Margin="5,0,0,0">(</TextBlock> <TextBlock Text="{Binding JournalEntry.Name}"/> <TextBlock Margin="5,0,0,0">)</TextBlock> </TextBlock> </TextBlock> </DataTemplate> <!--Create a style so that all the MenuItems will use the NavigateJournal command--> <Style x:Key="journalMenuItemContainerStyle"> <Setter Property="MenuItem.Command" Value="NavigationCommands.NavigateJournal" /> <Setter Property="MenuItem.CommandTarget" Value="{Binding ElementName=frame}" /> <Setter Property="MenuItem.CommandParameter" Value="{Binding RelativeSource={RelativeSource Self}}" /> </Style> </Window.Resources> ... <!-- Create the Navigation menu using the template and style defined in Window.Resources--> <MenuItem Header="Navigate Journal" ItemTemplate="{StaticResource journalMenuItemTemplate}" ItemContainerStyle="{StaticResource journalMenuItemContainerStyle}" > <!--Set the ItemsSource to be the IEnumerable returned from the JournalEntryUnifiedViewConverter--> <MenuItem.ItemsSource> <MultiBinding Converter="{StaticResource JournalEntryUnifiedViewConverter}" > <Binding ElementName="frame" Path="BackStack"/> <Binding ElementName="frame" Path="ForwardStack"/> </MultiBinding> </MenuItem.ItemsSource> </MenuItem> ... <!-- The following Frame is used to process NavigationCommands.NavigateJournal commands --> <Frame Name="frame" NavigationUIVisibility="Hidden" Source="Page1.xaml" /> ... </Window>
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.