Selection Change
OnSelectionChange reports the selected nodes and edges whenever the set really changes - by a click, a box, a key or your own code - so the page can show or act on it. SelectAsync changes the selection from code and raises it too.
selected nodes: -
selected edges: -
OnSelectionChange raised 0 times
Press Tab to move between the nodes and edges of the diagram.
Press Enter or Space to select it, Shift with Enter to add it to the selection, the arrow keys to move the selected nodes, Delete to remove them and Escape to clear the selection. Press C to start a connection from it.
Press Enter or Space to select it, Delete to remove it and Escape to clear the selection. Press C to move its end to another node.
bit BlowTry it
- Click a node or an edge: the panel lists it. Shift+click adds to the selection, and clicking the background clears it.
- Drag across the empty background to draw a selection box: on this page a plain drag selects, so hold Space while dragging to pan instead.
- Click the node that is already selected: nothing changed, so the count in the panel stays where it was.
- Press Ctrl+A (Cmd+A) with the canvas focused to select everything, and Escape to clear.
- Select input and output replaces the selection from code; Add node 2's edges adds to whatever is selected; Clear empties it. Each one updates the panel.
- Set node 3's Selected flips the flag directly: node 3 is drawn selected, but no event is raised, so the panel does not hear of it.
How it works
OnSelectionChangereceives aBlowSelectionChangewhoseNodesandEdgesare the full current selection. It is raised only when the selected set really differs from the last one reported, so handling it is cheap.SelectionOnDrag="true"makes a plain drag on the pane draw the box;PanActivationKey(Space) held turns the drag back into a pan.SelectAsync(nodes, edges)makes those elements the selection; withadditive: trueit adds them instead, and called with nothing it clears. Elements that are hidden or haveSelectable = falseare passed over.- Setting
BlowNode.SelectedorBlowEdge.Selectedyourself changes what is drawn but raises noOnSelectionChange- useSelectAsyncwhen listeners should know. - Ctrl/Cmd+A comes from
SelectAllKeyEnabled(on by default) and calls the sameSelectAllAsync()an app can call itself.