다음을 통해 공유


NavigationCommands.Search 속성

정의

Search 명령을 나타내는 값을 가져옵니다.

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

속성 값

라우트된 UI 명령입니다.

기본값
키 제스처 F3
UI 텍스트 검색

예제

다음 예제에서는 응답 하는 코드를 구현 하는 방법을 보여 줍니다 합니다 Search 와 함께에서 명령을 FlowDocumentPageViewer합니다.

<Window
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  x:Class="SDKSample.Search">

  <Window.CommandBindings>
    <CommandBinding
      Command="NavigationCommands.Search"
      CanExecute="navigationCommandSearch_CanExecute"
      Executed="navigationCommandSearch_Executed" />
  </Window.CommandBindings>
<!-- NavigationCommands.Search -->
<MenuItem Command="NavigationCommands.Search" />
<FlowDocumentPageViewer Name="flowDocumentPageViewer">
  <FlowDocument>
    <!-- Document Content-->
    <Paragraph>
      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;
    </Paragraph>
  </FlowDocument>
</FlowDocumentPageViewer>
</Window>
using System.Windows;
using System.Windows.Input;

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

        void navigationCommandSearch_CanExecute(object sender, CanExecuteRoutedEventArgs e)
        {
            // Can search of there is a document
            e.CanExecute = (this.flowDocumentPageViewer.Document != null);
        }

        void navigationCommandSearch_Executed(object target, ExecutedRoutedEventArgs e)
        {
            // Implement custom Search handling code
        }
    }
}

Namespace SDKSample
    Partial Public Class Search
        Inherits Window
        Public Sub New()
            InitializeComponent()
        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

설명

이 명령은 검색 함을 나타냅니다.

지정된 WPF 클래스에서 Search 명령에 응답하기 위한 구현은 없습니다. 따라서이 예제에 나와 있는 적절 한 구현을 제공 해야 합니다.

XAML 특성 사용

<object property="NavigationCommands.Search"/>  

적용 대상

추가 정보