2017-10-03 13 views

答えて

1

Visual Studioを使用しているときにクラスのIビームでF12キーを押すと、いつでもメタデータの意味を確認できます。
とにかく、RoutedUICommand(String, String, Type)の最初の文字列は説明文で、の2番目のの名前があり、3番目は所有者の種類です。それは同じである必要はありません。
は、この例hereを考えてみましょう:

public static RoutedCommand GreetUserCommand = new RoutedUICommand("Howdy! Just to say hello, nothing else.", "GreetUser", typeof(MainWindow)); 

とビューの使用:

<Window.CommandBindings> 
    <CommandBinding Command="{x:Static loc:MainWindow.GreetUserCommand}" 
        CanExecute="GreetUser_CanExecute" Executed="GreetUser_Executed"/> 
</Window.CommandBindings> 

<Window.ContextMenu> 
    <ContextMenu> 
     <MenuItem Command="{x:Static loc:MainWindow.GreetUserCommand}"/> 
    </ContextMenu> 
</Window.ContextMenu> 
+0

は答えてくれてありがとう! –

関連する問題