Udostępnij za pośrednictwem


SelectionOperations.Select Method

Processes a request to programmatically select an object in the designer.

Namespace:  Microsoft.Windows.Design.Interaction
Assembly:  Microsoft.Windows.Design.Interaction (in Microsoft.Windows.Design.Interaction.dll)

Syntax

'Declaration
Public Shared Function Select ( _
    context As EditingContext, _
    itemToSelect As ModelItem _
) As Selection
public static Selection Select(
    EditingContext context,
    ModelItem itemToSelect
)
public:
static Selection^ Select(
    EditingContext^ context, 
    ModelItem^ itemToSelect
)
static member Select : 
        context:EditingContext * 
        itemToSelect:ModelItem -> Selection 
public static function Select(
    context : EditingContext, 
    itemToSelect : ModelItem
) : Selection

Parameters

Return Value

Type: Microsoft.Windows.Design.Interaction.Selection
A new empty selection, a new selection containing new objects, or the existing selection. See the remarks section for more information.

Exceptions

Exception Condition
ArgumentNullException

context or itemToSelect is nulla null reference (Nothing in Visual Basic).

Remarks

If the specified object is already selected, this method promotes the object to be the primary selection object. Otherwise, this command clears any previous selection. To preserve the existing selection, use the Union method instead. This command selects multiple objects. To select a single object, use the SelectOnly method instead.

.NET Framework Security

See Also

Reference

SelectionOperations Class

Microsoft.Windows.Design.Interaction Namespace

Selection

SelectionCommands

SelectTarget

SelectionTool

EditingContext

Other Resources

WPF Designer Extensibility Architecture