Class IBlazorSelectionChangeEventArgs
Notifies when select or deselect any objects from the diagram.
Inheritance
Namespace: Syncfusion.Blazor.Diagrams
Assembly: Syncfusion.Blazor.dll
Syntax
public class IBlazorSelectionChangeEventArgs : Object
Examples
<SfDiagram Height="600px" Nodes="@NodeCollection">
<DiagramEvents SelectionChanged = "Selection" ></ DiagramEvents >
</ SfDiagram >
@code{
public ObservableCollection<DiagramNode> NodeCollection = new ObservableCollection<DiagramNode>();
public void Selection(IBlazorSelectionChangeEventArgs args)
{
args.Cancel = false;
if ((args != null) && (args.State == EventState.Changed) && (args.NewValue != null))
{
Console.WriteLine("Edited");
}
}
protected override void OnInitialized()
{
// A node is created and stored in the node array.
DiagramNode Node = new DiagramNode()
{
Id = "node1",
Height = 100,
Width = 100,
OffsetX = 300,
OffsetY = 100,
};
NodeCollection.Add(Node);
}
}
Constructors
IBlazorSelectionChangeEventArgs()
Declaration
public IBlazorSelectionChangeEventArgs()
Properties
Cancel
Users can define whether the element can be selected.
Declaration
public bool Cancel { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
Cause
Returns the actual cause of the event.
Declaration
public DiagramAction Cause { get; set; }
Property Value
Type | Description |
---|---|
DiagramAction | A DiagramAction enumeration value indicating the actual cause of the event. |
NewValue
Returns the selected element after the event has triggered.
Declaration
public DiagramEventObjectCollection NewValue { get; set; }
Property Value
Type | Description |
---|---|
DiagramEventObjectCollection | A DiagramEventObjectCollection representing the selected element after the event. |
OldValue
Returns the last selected elements, it's empty if previously, not objects have selected.
Declaration
public DiagramEventObjectCollection OldValue { get; set; }
Property Value
Type | Description |
---|---|
DiagramEventObjectCollection | A DiagramEventObjectCollection representing the previously selected elements. |
State
Triggers before and after adding the selection to the object
in the diagram which can be differentiated through state
argument.
We can cancel the event only before the selection of the object.
Declaration
public EventState State { get; set; }
Property Value
Type | Description |
---|---|
EventState | A EventState indicating whether the event is triggered before or after adding the selection to the object. |
Type
Returns whether the item is added or removed from the list.
Declaration
public ChangeType Type { get; set; }
Property Value
Type | Description |
---|---|
ChangeType | A ChangeType representing the type of change for an item in a list. |