ContextMenuItem 建構函式
適用於版本2
初始化 ContextMenuItem 類別的新執行個體。
命名空間: Microsoft.WebMatrix.Extensibility
組件: Microsoft.WebMatrix.Extensibility (在 Microsoft.WebMatrix.Extensibility.dll 中)
語法
'宣告
Public Sub New ( _
label As String, _
icon As ImageSource, _
command As ICommand, _
commandParameter As Object _
)
'用途
Dim label As String
Dim icon As ImageSource
Dim command As ICommand
Dim commandParameter As Object
Dim instance As New ContextMenuItem(label, icon, _
command, commandParameter)
public ContextMenuItem(
string label,
ImageSource icon,
ICommand command,
Object commandParameter
)
public:
ContextMenuItem(
String^ label,
ImageSource^ icon,
ICommand^ command,
Object^ commandParameter
)
new :
label:string *
icon:ImageSource *
command:ICommand *
commandParameter:Object -> ContextMenuItem
public function ContextMenuItem(
label : String,
icon : ImageSource,
command : ICommand,
commandParameter : Object
)
參數
label
型別:System.String項目的標籤。
icon
型別:System.Windows.Media.ImageSource項目的 16x16 影像。
command
型別:System.Windows.Input.ICommand要在選取項目時叫用的命令。
commandParameter
型別:System.Object命令的參數。