NavigationCommands.NavigateJournal Właściwość

Definicja

Pobiera wartość reprezentującą Navigate Journal polecenie.

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.RoutedUICommand
Public Shared ReadOnly Property NavigateJournal As RoutedUICommand

Wartość właściwości

Przekierowane polecenie interfejsu użytkownika.

Wartości domyślne
Gest klawisza Nie dotyczy
Tekst interfejsu użytkownika Dziennik nawigacji

Przykłady

W poniższym przykładzie pokazano, jak używać w NavigateJournal połączeniu z elementem Frame. Zapewnia Frame implementację, która odpowiada na NavigateJournal polecenie, przechodząc do określonego wpisu dziennika na stosach do przodu lub z tyłu obiektu Frame. Wpisy dziennika są dostarczane przez element JournalEntryUnifiedViewConverter do najwyższego poziomu Navigate JournalMenuItem. Każdy wpis dziennika jest powiązany z elementem podrzędnym MenuItem , który używa NavigateJournal polecenia .

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

Uwagi

To polecenie wskazuje zamiar nawigowania po dzienniku.

Frame i NavigationWindow zaimplementować obsługę odpowiadania NavigateJournal na polecenie, chociaż nie jest wymagane do jego użycia. W wielu przypadkach implementacja w odpowiedzi na to polecenie jest obowiązkiem modułu zapisywania aplikacji.

Użycie atrybutu języka XAML

<object property="NavigationCommands.NavigateJournal"/>  

Dotyczy

Zobacz też