Class DiagramSelectionSettings
Represents a visual representation of the selected elements. It behaves like a container for single or multiple selected elements.
Inheritance
Namespace: Syncfusion.Blazor.Diagram
Assembly: Syncfusion.Blazor.dll
Syntax
public class DiagramSelectionSettings : Object, IDiagramObject, ICloneable
Constructors
DiagramSelectionSettings()
Initializes a new instance of the DiagramSelectionSettings.
Declaration
public DiagramSelectionSettings()
DiagramSelectionSettings(DiagramSelectionSettings)
Creates a new instance of the Selector from the given Selector.
Declaration
public DiagramSelectionSettings(DiagramSelectionSettings src)
Parameters
Type | Name | Description |
---|---|---|
DiagramSelectionSettings | src | Selector |
Properties
Connectors
Specifies the collection of selected connectors.
Declaration
public ObservableCollection<Connector> Connectors { get; set; }
Property Value
Type |
---|
System.Collections.ObjectModel.ObservableCollection<Connector> |
Examples
<SfDiagramComponent ref="@diagram" Height="600px" Connectors="@nodes" />
@code
{
SfDiagramComponent diagram;
DiagramObjectCollection<Connector> connectors = new DiagramObjectCollection<Connector>();
protected override void OnInitialized()
{
Connector connector = new Connector()
{
ID = "connector1",
Type = ConnectorSegmentType.Straight,
SourcePoint = new DiagramPoint() { X = 100, Y = 100 },
TargetPoint = new DiagramPoint() { X = 200, Y = 200 },
};
connectors.Add(connector);
diagram.SelectionSettings.Connectors[0].Constraints |= ConnectorConstraints.Delete;
}
}
Constraints
Enables or disables certain behaviors of the selector.
Declaration
public SelectorConstraints Constraints { get; set; }
Property Value
Type |
---|
SelectorConstraints |
Examples
<SfDiagramComponent ref="@diagram" Height="600px" Connectors="@nodes" />
@code
{
SfDiagramComponent diagram;
//Initialize the node collection with node and with Expand & CollapseIcon
DiagramObjectCollection<Connector> connectors = new DiagramObjectCollection<Connector>();
protected override void OnInitialized()
{
Connector connector = new Connector()
{
ID = "connector1",
Type = ConnectorSegmentType.Straight,
SourcePoint = new DiagramPoint() { X = 100, Y = 100 },
TargetPoint = new DiagramPoint() { X = 200, Y = 200 },
//set the ConnectorConstraints...
Constraints = ConnectorConstraints.Default & ~ConnectorConstraints.Select
};
connectors.Add(connector);
diagram.SelectionSettings.Connectors[0].Constraints |= ConnectorConstraints.Delete;
}
}
Header
Gets or sets the header associated with the selected lane or phase element.
Declaration
public SwimlaneHeader Header { get; set; }
Property Value
Type | Description |
---|---|
SwimlaneHeader | The header of the selected lane or phase, represented by a SwimlaneHeader object. |
Height
Gets or sets the height of the selected region.
Declaration
public double Height { get; set; }
Property Value
Type | Description |
---|---|
System.Double | Accepts the double value. |
Examples
<SfDiagramComponent ref="@diagram" SelectionSettings="@select" Height="600px" Nodes="@nodes" />
@code
{
SfDiagramComponent diagram;
DiagramObjectCollection<Node> nodes = new DiagramObjectCollection<Node>();
protected override void OnInitialized()
{
Node node = new Node()
{
ID = "node1",
//Size of the node
Height = 100,
Width = 100,
//Position of the node
OffsetX = 100,
OffsetY = 100,
};
nodes.Add(node);
DiagramSelectionSettings select = new DiagramSelectionSettings() { Width =100, Height=150 };
}
}
Lanes
Gets or sets the collection of selected lanes in the diagram.
Declaration
public ObservableCollection<Lane> Lanes { get; set; }
Property Value
Type | Description |
---|---|
System.Collections.ObjectModel.ObservableCollection<Lane> | The collection of selected lanes represented by an ObservableCollection of Lane objects. |
Nodes
Specifies the collection of selected nodes.
Declaration
public ObservableCollection<Node> Nodes { get; set; }
Property Value
Type |
---|
System.Collections.ObjectModel.ObservableCollection<Node> |
Examples
<SfDiagramComponent ref="@diagram" Height="600px" Nodes="@nodes" />
@code
{
SfDiagramComponent diagram;
DiagramObjectCollection<Node> nodes = new DiagramObjectCollection<Node>();
protected override void OnInitialized()
{
Node node = new Node()
{
ID = "node1",
//Size of the node
Height = 100,
Width = 100,
//Position of the node
OffsetX = 100,
OffsetY = 100,
};
nodes.Add(node);
diagram.SelectionSettings.Nodes[0].Constraints |= NodeConstraints.AspectRatio;
}
}
OffsetX
Gets or sets the X-coordinate of the selected region. Its value may vary based on the selected region.
Declaration
public double OffsetX { get; set; }
Property Value
Type | Description |
---|---|
System.Double | Accepts the double value. |
Examples
<SfDiagramComponent ref="@diagram" SelectionSettings="@select" Height="600px" Nodes="@nodes" />
@code
{
SfDiagramComponent diagram;
DiagramObjectCollection<Node> nodes = new DiagramObjectCollection<Node>();
protected override void OnInitialized()
{
Node node = new Node()
{
ID = "node1",
//Size of the node
Height = 100,
Width = 100,
//Position of the node
OffsetX = 100,
OffsetY = 100,
};
nodes.Add(node);
DiagramSelectionSettings select = new DiagramSelectionSettings() {OffsetX = 100, Width =100, Height=150 };
}
}
OffsetY
Gets or sets the Y-coordinate of the selected region. Its value differs based on the selected region.
Declaration
public double OffsetY { get; set; }
Property Value
Type | Description |
---|---|
System.Double | Accepts the double value. |
Examples
<SfDiagramComponent ref="@diagram" SelectionSettings="@select" Height="600px" Nodes="@nodes" />
@code
{
SfDiagramComponent diagram;
DiagramObjectCollection<Node> nodes = new DiagramObjectCollection<Node>();
protected override void OnInitialized()
{
Node node = new Node()
{
ID = "node1",
//Size of the node
Height = 100,
Width = 100,
//Position of the node
OffsetX = 100,
OffsetY = 100,
};
nodes.Add(node);
DiagramSelectionSettings select = new DiagramSelectionSettings() {OffsetY = 100,OffsetX = 100, Width =100, Height=150 };
}
}
Phases
Gets or sets the collection of selected phases in the diagram.
Declaration
public ObservableCollection<Phase> Phases { get; set; }
Property Value
Type | Description |
---|---|
System.Collections.ObjectModel.ObservableCollection<Phase> | The collection of selected phases represented by an ObservableCollection of Phase objects. |
Pivot
Gets or sets the ratio/fractional value relative to the node, based on which the node will be transformed (positioning, scaling, and rotation).
Declaration
public DiagramPoint Pivot { get; set; }
Property Value
Type |
---|
DiagramPoint |
Examples
<SfDiagramComponent ref="@diagram" SelectionSettings="@select" Height="600px" Nodes="@nodes" />
@code
{
SfDiagramComponent diagram;
DiagramObjectCollection<Node> nodes = new DiagramObjectCollection<Node>();
protected override void OnInitialized()
{
Node node = new Node()
{
ID = "node1",
//Size of the node
Height = 100,
Width = 100,
//Position of the node
OffsetX = 100,
OffsetY = 100,
};
nodes.Add(node);
DiagramSelectionSettings select = new DiagramSelectionSettings() {Pivot = new DiagramPoint() { X = 0.5, Y = 0.5 }, Width =100, Height=150 };
}
}
RotationAngle
Gets or sets the angle at which the node should be rotated.
Declaration
public double RotationAngle { get; set; }
Property Value
Type | Description |
---|---|
System.Double | Accepts the double value. |
Examples
<SfDiagramComponent ref="@diagram" SelectionSettings="@select" Height="600px" Nodes="@nodes" />
@code
{
SfDiagramComponent diagram;
DiagramObjectCollection<Node> nodes = new DiagramObjectCollection<Node>();
protected override void OnInitialized()
{
Node node = new Node()
{
ID = "node1",
//Size of the node
Height = 100,
Width = 100,
//Position of the node
OffsetX = 100,
OffsetY = 100,
};
nodes.Add(node);
DiagramSelectionSettings select = new DiagramSelectionSettings() {RotationAngle = 60,OffsetY = 100,OffsetX = 100, Width =100, Height=150 };
}
}
RubberBandSelectionMode
Specifies whether the diagram objects can be selected when the selection region intersects with the objects or only when the complete object's bounds are within the selection region.
Declaration
public RubberBandSelectionMode RubberBandSelectionMode { get; set; }
Property Value
Type |
---|
RubberBandSelectionMode |
Examples
<SfDiagramComponent ref="@diagram" SelectionSettings="@select" Height="600px" Nodes="@nodes" />
@code
{
SfDiagramComponent diagram;
//Initialize the node collection with node and with Expand & CollapseIcon
DiagramObjectCollection<Node> nodes = new DiagramObjectCollection<Node>();
DiagramObjectCollection<UserHandle> handles = new DiagramObjectCollection<UserHandle>()
{ new UserHandle(){ Name= "handle1", PathData= "M10.13,0 L1.45,0 C0.66,0,0,0.55,0,1.26 L0,10 L1.45,10 L1.45,1.26 L10.1,1.26 L10.1,0 Z M12.3,2.49 L4.36,2.49 C3.57,2.49,2.91,3.04,2.91,3.75 L2.91,12.49 C2.91,13.18,3.54,13.75,4.36,13.75 L12.3,13.75 C13.09,13.75,13.75,13.2,13.75,12.49 L13.75,3.75 C13.72,3.07,13.09,2.49,12.3,2.49 Z M12.3,12.47 L4.36,12.47 L4.36,3.75 L12.3,3.75 L12.3,12.47 Z"};
protected override void OnInitialized()
{
Node node = new Node()
{
ID = "node1",
//Size of the node
Height = 100,
Width = 100,
//Position of the node
OffsetX = 100,
OffsetY = 100,
};
nodes.Add(node);
DiagramSelectionSettings select = new DiagramSelectionSettings() {RubberBandSelectionMode= RubberBandSelectionMode.CompleteIntersect};
}
}
Swimlanes
Gets or sets the collection of selected swimlanes in the diagram.
Declaration
public ObservableCollection<Swimlane> Swimlanes { get; set; }
Property Value
Type | Description |
---|---|
System.Collections.ObjectModel.ObservableCollection<Swimlane> | The collection of selected swimlanes represented by an ObservableCollection of Swimlane objects. |
UserHandles
Defines the collection of UserHandles.
Declaration
public DiagramObjectCollection<UserHandle> UserHandles { get; set; }
Property Value
Type |
---|
DiagramObjectCollection<UserHandle> |
Examples
<SfDiagramComponent ref="@diagram" SelectionSettings="@select" Height="600px" Nodes="@nodes" />
@code
{
SfDiagramComponent diagram;
//Initialize the node collection with node and with Expand & CollapseIcon
DiagramObjectCollection<Node> nodes = new DiagramObjectCollection<Node>();
DiagramObjectCollection<UserHandle> handles = new DiagramObjectCollection<UserHandle>()
{ new UserHandle(){ Name= "handle1", PathData= "M10.13,0 L1.45,0 C0.66,0,0,0.55,0,1.26 L0,10 L1.45,10 L1.45,1.26 L10.1,1.26 L10.1,0 Z M12.3,2.49 L4.36,2.49 C3.57,2.49,2.91,3.04,2.91,3.75 L2.91,12.49 C2.91,13.18,3.54,13.75,4.36,13.75 L12.3,13.75 C13.09,13.75,13.75,13.2,13.75,12.49 L13.75,3.75 C13.72,3.07,13.09,2.49,12.3,2.49 Z M12.3,12.47 L4.36,12.47 L4.36,3.75 L12.3,3.75 L12.3,12.47 Z"};
protected override void OnInitialized()
{
Node node = new Node()
{
ID = "node1",
//Size of the node
Height = 100,
Width = 100,
//Position of the node
OffsetX = 100,
OffsetY = 100,
};
nodes.Add(node);
DiagramSelectionSettings select = new DiagramSelectionSettings() {UserHandles=handles};
}
}
Width
Gets or sets the width of the selection region. Its value differs based on the selected region.
Declaration
public double Width { get; set; }
Property Value
Type | Description |
---|---|
System.Double | Accepts the double value. |
Examples
<SfDiagramComponent ref="@diagram" SelectionSettings="@select" Height="600px" Nodes="@nodes" />
@code
{
SfDiagramComponent diagram;
DiagramObjectCollection<Node> nodes = new DiagramObjectCollection<Node>();
protected override void OnInitialized()
{
Node node = new Node()
{
ID = "node1",
//Size of the node
Height = 100,
Width = 100,
//Position of the node
OffsetX = 100,
OffsetY = 100,
};
nodes.Add(node);
DiagramSelectionSettings select = new DiagramSelectionSettings() { Width =100, Height=150 };
}
}
Methods
Clone()
Creates a new selector that is a copy of the current selector.
Declaration
public virtual object Clone()
Returns
Type | Description |
---|---|
System.Object | it returns selector |
OnPropertyChanged(String, Object, Object, IDiagramObject)
Invoked when the effective value of any property on this selector has been updated.
Declaration
public void OnPropertyChanged(string propertyName, object newVal, object oldVal, IDiagramObject container)
Parameters
Type | Name | Description |
---|---|---|
System.String | propertyName | string that contains the propertyname. |
System.Object | newVal | An object that contain newvalue, which means new value of property |
System.Object | oldVal | An object that contain oldvalue, which means old value of property |
IDiagramObject | container | An IPaletteObject that contain IDiagramObject |