Share via


SelectionOperations.Union Method

Processes a request to programmatically add an object in the designer to the existing selection.

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

Syntax

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

Parameters

Return Value

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

Exceptions

Exception Condition
ArgumentNullException

context or itemToAdd 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. This command does not clear any previous selection. To clear the previous selection, use the Select or SelectOnly methods instead.

.NET Framework Security

See Also

Reference

SelectionOperations Class

Microsoft.Windows.Design.Interaction Namespace

Selection

SelectionCommands

UnionSelectTarget

SelectionTool

EditingContext

Other Resources

WPF Designer Extensibility Architecture