NavigationCommands::Favorites Property

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Gets the value that represents the Favorites command.

Namespace:   System.Windows.Input
Assembly:  PresentationCore (in PresentationCore.dll)

public:
property RoutedUICommand^ Favorites {
	static RoutedUICommand^ get();
}

Property Value

Type: System.Windows.Input::RoutedUICommand^

The routed UI command.

Default Values

Key Gesture

CTRL+I

UI Text

Favorites

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.

<object property="NavigationCommands.Favorites"/>

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>

.NET Framework
Available since 3.0
Return to top
Show: