ISelectionItemProvider.Select 方法

定义

取消选择所有选定项,然后选择当前元素。

public:
 void Select();
public void Select ();
abstract member Select : unit -> unit
Public Sub Select ()

示例

以下示例代码清除选定项集合中的所有项,然后添加此项目。

/// <summary>
/// Selects the item.
/// </summary>
/// <remarks>
/// selectedItems is the collection of selected ListItems.
/// </remarks>
public void Select()
{
    selectedItems.Clear();
    selectedItems.Add(this);
    // TODO: Update UI.
}
''' <summary>
''' Selects the item.
''' </summary>
''' <remarks>
''' selectedItems is the collection of selected ListItems.
''' </remarks>
Public Sub [Select]() Implements ISelectionItemProvider.Select
    selectedItems.Clear()
    selectedItems.Add(Me)
    ' TODO: Update UI.
End Sub

适用于

另请参阅