NavigationCommands.NavigateJournal Proprietà
Definizione
Importante
Alcune informazioni sono relative alla release non definitiva del prodotto, che potrebbe subire modifiche significative prima della release definitiva. Microsoft non riconosce alcuna garanzia, espressa o implicita, in merito alle informazioni qui fornite.
Ottiene il valore che rappresenta il comando 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
Valore della proprietà
Comando indirizzato dell'interfaccia utente.
Valori predefiniti | |
---|---|
Combinazione di tasti | N/D |
Testo interfaccia utente | Navigazione journal |
Esempio
Nell'esempio seguente viene illustrato come usare NavigateJournal in combinazione con un oggetto Frame. fornisce Frame un'implementazione che risponde al NavigateJournal comando passando alla voce del journal specificata negli stack forward o back dell'oggetto Frame. Le voci del journal vengono fornite dall'oggetto JournalEntryUnifiedViewConverter al livello Navigate Journal
MenuItemsuperiore. Ogni voce del journal è associata a un elemento figlio MenuItem che usa il NavigateJournal comando .
<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>
Commenti
Questo comando indica l'intenzione di spostarsi nel journal.
Frame e NavigationWindow implementano il supporto per rispondere al NavigateJournal comando, anche se non è necessario usarlo. In molti casi l'implementazione in risposta a tale comando è responsabilità del writer dell'applicazione.
Uso della sintassi XAML per gli attributi
<object property="NavigationCommands.NavigateJournal"/>
Si applica a
Vedi anche
Commenti e suggerimenti
https://aka.ms/ContentUserFeedback.
Presto disponibile: Nel corso del 2024 verranno gradualmente disattivati i problemi di GitHub come meccanismo di feedback per il contenuto e ciò verrà sostituito con un nuovo sistema di feedback. Per altre informazioni, vedereInvia e visualizza il feedback per