NavigationCommands.Search Property


Gets the value that represents the Search command.

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

Public Shared ReadOnly Property Search As RoutedUICommand

Property Value

Type: System.Windows.Input.RoutedUICommand

The routed UI command.

Default Values

Key Gesture


UI Text


This command indicates the intention to search.

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

<object property="NavigationCommands.Search"/>

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


      Executed="navigationCommandSearch_Executed" />
<!-- NavigationCommands.Search -->
<MenuItem Command="NavigationCommands.Search" />
<FlowDocumentPageViewer Name="flowDocumentPageViewer">
    <!-- Document Content-->
      Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Sed vulputate, lacus non sagittis pharetra, diam dolor dictum tellus, et hendrerit odio risus nec erat. Nam sollicitudin imperdiet mi. Sed rutrum. Morbi vel nunc. Donec imperdiet. Morbi hendrerit leo. Maecenas imperdiet. Curabitur viverra tempor nisi. Phasellus vitae augue sit amet neque venenatis elementum. Proin posuere lobortis quam. Curabitur et neque. Donec ac sem vitae libero pharetra luctus. Fusce purus. Nulla vehicula, leo commodo dictum lobortis, odio augue accumsan ante, id dictum nisi libero quis diam. Nam augue erat, malesuada eu, tincidunt eu, dictum ut, ante. In vel magna vel ligula faucibus lobortis. Praesent a felis non mi fringilla vulputate. Integer quis tellus cursus elit tincidunt vehicula. Morbi commodo sem eu eros. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae;

Namespace SDKSample
	Partial Public Class Search
		Inherits Window
		Public Sub New()
		End Sub

		Private Sub navigationCommandSearch_CanExecute(ByVal sender As Object, ByVal e As CanExecuteRoutedEventArgs)
			' Can search of there is a document
			e.CanExecute = (Me.flowDocumentPageViewer.Document IsNot Nothing)
		End Sub

		Private Sub navigationCommandSearch_Executed(ByVal target As Object, ByVal e As ExecutedRoutedEventArgs)
			' Implement custom Search handling code
		End Sub
	End Class
End Namespace

.NET Framework
Available since 3.0
Return to top