NavigationCommands.NavigateJournal プロパティ

定義

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

プロパティ値

ルーティングされた UI コマンド。

既定値
キー ジェスチャ 該当なし
UI テキスト ジャーナルのナビゲーション

次の例は、 と組み合わせて を使用 NavigateJournal する方法を Frame示しています。 は Frame 、 の前方スタックまたはバック スタック上の指定されたジャーナル エントリに移動することによって、 コマンドに応答 NavigateJournal する実装を Frame提供します。 ジャーナル エントリは、 によって JournalEntryUnifiedViewConverter 最上位レベル Navigate JournalMenuItemに提供されます。 各ジャーナル 項目は、 コマンドを使用する子 MenuItemNavigateJournal バインドされます。

<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コマンドにNavigateJournal応答するためのサポートを実装しますNavigationWindowが、使用する必要はありません。多くの場合、そのコマンドに応答する実装はアプリケーション ライターの責任です。

XAML 属性の使用方法

<object property="NavigationCommands.NavigateJournal"/>  

適用対象

こちらもご覧ください