Share via


SelectionOperations.SelectOnly Method

Processes a request to programmatically select a single 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 SelectOnly ( _
    context As EditingContext, _
    itemToSelect As ModelItem _
) As Selection
public static Selection SelectOnly(
    EditingContext context,
    ModelItem itemToSelect
)
public:
static Selection^ SelectOnly(
    EditingContext^ context, 
    ModelItem^ itemToSelect
)
static member SelectOnly : 
        context:EditingContext * 
        itemToSelect:ModelItem -> Selection 
public static function SelectOnly(
    context : EditingContext, 
    itemToSelect : ModelItem
) : Selection

Parameters

Return Value

Type: Microsoft.Windows.Design.Interaction.Selection
A selection containing the object to select.

Exceptions

Exception Condition
ArgumentNullException

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

Remarks

This command clears any previous selection. To preserve the existing selection, use the Union method instead. This command selects only one object. To select multiple objects, use the Select method instead.

.NET Framework Security

See Also

Reference

SelectionOperations Class

Microsoft.Windows.Design.Interaction Namespace

Selection

SelectionCommands

SelectOnlyTarget

SelectionTool

EditingContext

Other Resources

WPF Designer Extensibility Architecture