NavigationCommands.NavigateJournal Eigenschaft

Definition

Ruft den Wert ab, der den Befehl „Navigate Journal“ darstellt.

public:
 static property System::Windows::Input::RoutedUICommand ^ NavigateJournal { System::Windows::Input::RoutedUICommand ^ get(); };
public static System.Windows.Input.RoutedUICommand NavigateJournal { get; }
member this.NavigateJournal : System.Windows.Input.RoutedUICommand
Public Shared ReadOnly Property NavigateJournal As RoutedUICommand

Eigenschaftswert

RoutedUICommand

Der Befehl "Routed UI".

Standardwerte
Tastenkombination Nicht zutreffend
Text der Benutzeroberfläche Journalnavigation

Beispiele

Im folgenden Beispiel wird gezeigt, wie NavigateJournal sie in Verbindung mit einer Frame. Dies Frame stellt eine Implementierung bereit, die auf den NavigateJournal Befehl reagiert, indem Sie zum angegebenen Journaleintrag entweder auf den Vorwärts- oder Zurückstapel des FrameAngegebenen Journaleintrags navigieren. Die Journaleinträge werden von der JournalEntryUnifiedViewConverter obersten Ebene Navigate Journal MenuItembereitgestellt. Jeder Journaleintrag ist an ein untergeordnetes Element MenuItem gebunden, das den NavigateJournal Befehl verwendet.

<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>

Hinweise

Dieser Befehl gibt die Absicht an, das Journal zu navigieren.

Frame und NavigationWindow implementieren Sie Unterstützung für die Reaktion auf den NavigateJournal Befehl, obwohl Sie sie nicht verwenden müssen. In vielen Fällen ist die Implementierung als Reaktion auf diesen Befehl die Verantwortung des Anwendungsautors.

Verwendung von XAML-Attributen

<object property="NavigationCommands.NavigateJournal"/>  

Gilt für:

Siehe auch