Επεξεργασία

Κοινή χρήση μέσω


NavigationCommands.Favorites Property

Definition

Gets the value that represents the Favorites command.

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

Property Value

The routed UI command.

Default Values
Key Gesture CTRL+I
UI Text Favorites

Examples

The following example shows how to implement code that responds to the Favorites command in conjunction with a Frame.

<Window
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  x:Class="SDKSample.Favorites">
<!-- NavigationCommands.Favorites -->
<MenuItem Command="NavigationCommands.Favorites">
  <MenuItem.CommandBindings>
    <!-- NavigationCommands.Favorites Binding-->
    <CommandBinding
      Command="NavigationCommands.Favorites"
      CanExecute="navigationCommandFavorites_CanExecute"
      Executed="navigationCommandFavorites_Executed" />
  </MenuItem.CommandBindings>
</MenuItem>
<Frame Name="frame" NavigationUIVisibility="Hidden" Source="Page1.xaml" />
</Window>

Remarks

This command indicates the intention to manage and navigate to favorites.

There is no implementation for responding to the Favorites command on any given WPF class. As such, you need to provide an appropriate implementation, which is shown in the example.

XAML Attribute Usage

<object property="NavigationCommands.Favorites"/>  

Applies to

See also