SelectionOperations.Toggle Method
Processes a request to programmatically toggle the selection state of 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 Toggle ( _
context As EditingContext, _
itemToToggle As ModelItem _
) As Selection
public static Selection Toggle(
EditingContext context,
ModelItem itemToToggle
)
public:
static Selection^ Toggle(
EditingContext^ context,
ModelItem^ itemToToggle
)
static member Toggle :
context:EditingContext *
itemToToggle:ModelItem -> Selection
public static function Toggle(
context : EditingContext,
itemToToggle : ModelItem
) : Selection
Parameters
- context
Type: Microsoft.Windows.Design.EditingContext
The current editing context.
- itemToToggle
Type: Microsoft.Windows.Design.Model.ModelItem
The object to select or deselect.
Return Value
Type: Microsoft.Windows.Design.Interaction.Selection
A new selection that contains or does not contain the object to toggle. See the remarks section for more information.
Exceptions
Exception | Condition |
---|---|
ArgumentNullException | context or itemToToggle is nulla null reference (Nothing in Visual Basic). |
Remarks
If the specified object is already selected, it is deselected. If it is the only selected item, this method attempts to select the parent of the object.
If the specified object is not selected, it becomes selected and it becomes the primary selection object.
This command does not change the selected state of any other objects in the designer.
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.
See Also
Reference
Microsoft.Windows.Design.Interaction Namespace