NavigationCommands.NavigateJournal 属性   
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
获取表示 Navigate Journal 命令的值。
public:
 static property System::Windows::Input::RoutedUICommand ^ NavigateJournal { System::Windows::Input::RoutedUICommand ^ get(); };public static System.Windows.Input.RoutedUICommand NavigateJournal { get; }static member NavigateJournal : System.Windows.Input.RoutedUICommandPublic Shared ReadOnly Property NavigateJournal As RoutedUICommand属性值
路由的 UI 命令。
| 默认值 | |
|---|---|
| 键手势 | N/A | 
| UI 文本 | 导航日记 | 
示例
以下示例演示如何将 NavigateJournal 与 Frame结合使用。 
              Frame 通过导航到 Frame向前或后退堆栈上的指定日记条目,提供响应 NavigateJournal 命令的实现。 日记条目由 JournalEntryUnifiedViewConverter 提供给顶级 Navigate JournalMenuItem。 每个日记条目都绑定到使用 NavigateJournal 命令的子 MenuItem。
<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>
注解
此命令指示用于导航日记的意图。
Frame 和 NavigationWindow 实现对响应 NavigateJournal 命令的支持,尽管你不需要使用它;在许多情况下,响应该命令的实现是应用程序编写器的责任。
XAML 属性用法
<object property="NavigationCommands.NavigateJournal"/>