NavigationCommands.BrowseHome Property

Definition

Gets the value that represents the Browse Home command.

C#
public static System.Windows.Input.RoutedUICommand BrowseHome { get; }

Property Value

The routed UI command.

Default Values
Key Gesture ALT+HOME
UI Text Home

Examples

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

XAML
<Window
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  x:Class="SDKSample.BrowseHome">
XAML
<!-- NavigationCommands.BrowseHome -->
<MenuItem Command="NavigationCommands.BrowseHome">
  <MenuItem.CommandBindings>
    <!-- NavigationCommands.BrowseHome Binding-->
    <CommandBinding
      Command="NavigationCommands.BrowseHome"
      CanExecute="navigationCommandBrowseHome_CanExecute"
      Executed="navigationCommandBrowseHome_Executed" />
  </MenuItem.CommandBindings>
</MenuItem>
XAML
<Frame Name="frame" NavigationUIVisibility="Hidden" Source="Page1.xaml" />
XAML
</Window>
C#
using System.Windows;
using System.Windows.Input;

namespace SDKSample
{
    public partial class BrowseHome : Window
    {
        public BrowseHome()
        {
            InitializeComponent();
        }

        void navigationCommandBrowseHome_CanExecute(object sender, CanExecuteRoutedEventArgs e)
        {
            // Can always navigate home
            e.CanExecute = true;
        }

        void navigationCommandBrowseHome_Executed(object target, ExecutedRoutedEventArgs e)
        {
            // Implement custom BrowseHome handling code
        }
    }
}

Remarks

This command indicates the intention to navigate home.

There is no implementation for responding to the BrowseHome 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.BrowseHome"/>  

Applies to

Product Versions
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

See also