Class UserHandle
Represents how to execute the commonly or frequently used commands around the nodes, connectors and groups.
Inherited Members
Namespace: Syncfusion.Blazor.Diagram
Assembly: Syncfusion.Blazor.dll
Syntax
public class UserHandle : DiagramObject, IDiagramObject, ICloneable
Constructors
UserHandle()
Initializes a new instance of the UserHandle.
Declaration
public UserHandle()
UserHandle(UserHandle)
Creates a new instance of the UserHandle from the given UserHandle.
Declaration
public UserHandle(UserHandle src)
Parameters
Type | Name | Description |
---|---|---|
UserHandle | src | UserHandle. |
Properties
BackgroundColor
Gets or sets the background color of the user handle.
Declaration
public string BackgroundColor { get; set; }
Property Value
Type | Description |
---|---|
System.String | The default value is black |
Examples
UserHandle = new UserHandle()
{
Name = "user1",
ID="user2",
BackgroundColor= "red",
};
BorderColor
Gets or sets the border color of the user handle.
Declaration
public string BorderColor { get; set; }
Property Value
Type | Description |
---|---|
System.String | The default value will be System.String.Empty |
Examples
UserHandle = new UserHandle()
{
Name = "user1",
ID="user2",
BorderColor= "red",
};
BorderWidth
Gets or sets the border width of the user handle.
Declaration
public double BorderWidth { get; set; }
Property Value
Type | Description |
---|---|
System.Double | The default value is 0.5 |
Examples
UserHandle = new UserHandle()
{
Name = "user1",
ID="user2",
BorderWidth= 8,
};
Displacement
Gets or sets the displacement(margin) of the user handle. Applicable only if the parent is a connector.
Declaration
public double Displacement { get; set; }
Property Value
Type | Description |
---|---|
System.Double | The default value is 10 |
Examples
UserHandle = new UserHandle()
{
Name = "user1",
ID="user2",
Displacement= 10,
};
HorizontalAlignment
Gets or sets the horizontal alignment of the user handle.
Declaration
public HorizontalAlignment HorizontalAlignment { get; set; }
Property Value
Type | Description |
---|---|
HorizontalAlignment | The default value will be Center |
Remarks
The following options are used to define the Horizontal Alignment of the userhandle. |
1. Stretch - Stretches the diagram element throughout the userhandle. |
2. Left - Aligns the diagram element at the left of the userhandle. |
3. Right - Aligns the diagram element at the right of the userhandle. |
4. Center - Aligns the diagram element at the center of the userhandle. |
5. Auto - Aligns the diagram element based on the characteristics of the userhandle. |
Examples
UserHandle = new UserHandle()
{
Name = "user1",
ID="user2",
Margin = new DiagramThickness() { Top = 0, Bottom = 0, Left = 0, Right = 0 }
};
ID
Gets or sets the unique id of the diagram object.
Declaration
public string ID { get; set; }
Property Value
Type |
---|
System.String |
Examples
UserHandle = new UserHandle()
{
Name = "user1",
ID="user2",
};
ImageUrl
Gets or sets the URL of the image associated with the user handle. Applicable only if it is an image.
Declaration
public string ImageUrl { get; set; }
Property Value
Type | Description |
---|---|
System.String | A string value representing the URL of the image. The default value is System.String.Empty. |
Examples
UserHandle = new UserHandle()
{
Name = "user1",
ID="user2",
ImageUrl="https://www.w3schools.com/images/w3schools_green.jpg",
};
Margin
Gets or sets the extra space around the outer boundaries of the user handle. Applicable only if the parent is a node.
Declaration
public DiagramThickness Margin { get; set; }
Property Value
Type | Description |
---|---|
DiagramThickness | By default,it is 0 from all the sides. |
Examples
UserHandle = new UserHandle()
{
Name = "user1",
ID="user2",
Margin = new DiagramThickness() { Top = 0, Bottom = 0, Left = 0, Right = 0 }
};
Name
Gets or sets the name of the user handle.
Declaration
public string Name { get; set; }
Property Value
Type | Description |
---|---|
System.String | The default value will be System.String.Empty |
Examples
UserHandle = new UserHandle()
{
Name = "user1",
};
Offset
Gets or sets the X and Y coordinates of the user handle.
Declaration
public double Offset { get; set; }
Property Value
Type | Description |
---|---|
System.Double | The default value is 0 |
Examples
UserHandle = new UserHandle()
{
Name = "user1",
ID="user2",
Offset = 0.3
};
PathColor
Gets or sets the stroke color of the shape.
Declaration
public string PathColor { get; set; }
Property Value
Type | Description |
---|---|
System.String | The default value is white |
Examples
UserHandle = new UserHandle()
{
Name = "user1",
ID="user2",
PathColor= "brown"
};
PathData
Represents the custom geometry(shape) of the user handle.
Declaration
public string PathData { get; set; }
Property Value
Type |
---|
System.String |
Examples
UserHandle = new UserHandle()
{
Name = "user1",
ID="user2",
PathData = "M60.3,18H27.5c-3,0-5.5,2.4-5.5,5.5v38.2h5.5V23.5h32.7V18z M68.5,28.9h-30c-3,0-5.5,2.4-5.5,5.5v38.2c0,3,2.4,5.5,5.5,5.5h30c3,0,5.5-2.4,5.5-5.5V34.4C73.9,31.4,71.5,28.9,68.5,28.9z M68.5,72.5h-30V34.4h30V72.5z"
};
Side
Gets or sets the position of user Handle
Declaration
public Direction Side { get; set; }
Property Value
Type | Description |
---|---|
Direction | The default value will be Top |
Remarks
The following options are used to define the direction of the userhandle. |
1. Left - Sets the direction of the userhandle to Left. |
2. Right - Sets the direction of userhandle to Right. |
3. Top - Sets the direction of userhandle to Top. |
4. Bottom - Sets the direction of userhandle to Bottom. |
Examples
UserHandle = new UserHandle()
{
Name = "user1",
ID="user2",
BackgroundColor= "red",
Side= Direction.Bottom,
};
Size
Gets or sets the size of the user handle.
Declaration
public double Size { get; set; }
Property Value
Type | Description |
---|---|
System.Double | The default value is 25 |
Examples
UserHandle = new UserHandle()
{
Name = "user1",
ID="user2",
Size= 8,
};
Source
Gets or sets the image source of the user handle. Applicable only if it is an image.
Declaration
public string Source { get; set; }
Property Value
Type |
---|
System.String |
Remarks
This property is deprecated. Use ImageUrl instead.
Examples
UserHandle = new UserHandle()
{
Name = "user1",
ID="user2",
Source="https://www.w3schools.com/images/w3schools_green.jpg",
};
Template
Gets or sets the geometry of the html element.
Declaration
public bool Template { get; set; }
Property Value
Type |
---|
System.Boolean |
Examples
<SfDiagramComponent>
<DiagramTemplates>
<UserHandleTemplate>
@{ var id = (context as Node).ID;
<div style="height: 100%; width: 100%; background:green">
<input type="button" value="Button1" @onclick="@OnClick" />
</div>
}
</UserHandleTemplate>
</DiagramTemplates>
</SfDiagramComponent>
@code
{
UserHandle = new UserHandle()
{
Name = "user1",
ID="user2",
};
}
Tooltip
Gets or sets the message that is displayed when the mouse hovers over a user handle.
Declaration
public DiagramTooltip Tooltip { get; set; }
Property Value
Type | Description |
---|---|
DiagramTooltip | The default value is |
Examples
The following example demonstrates creating a user handle with a tooltip in Razor syntax:
UserHandle cloneHandle = new UserHandle
{
Name = "clone",
Offset = 0,
Visible = true,
VisibleTarget = VisibleTarget.Node,
Side = Direction.Top,
Margin = new DiagramThickness { Top = 0, Bottom = 0, Left = 0, Right = 0 },
Tooltip = new DiagramTooltip { Content = "NodeTooltip" }
};
VerticalAlignment
Gets or sets the vertical alignment of the user handle.
Declaration
public VerticalAlignment VerticalAlignment { get; set; }
Property Value
Type | Description |
---|---|
VerticalAlignment | The default value will be Center |
Remarks
The following options are used to define the Vertical Alignment of the userhandle. |
1. Stretch - Stretches the diagram element throughout the userhandle. |
2. Top - Aligns the diagram element at the top of the userhandle. |
3. Bottom - Aligns the diagram element at the bottom of the userhandle. |
4. Center - Aligns the diagram element at the center of the userhandle. |
5. Auto - Aligns the diagram element based on the characteristics of the userhandle. |
Examples
UserHandle = new UserHandle()
{
Name = "user1",
ID="user2",
Margin = new DiagramThickness() { Top = 0, Bottom = 0, Left = 0, Right = 0 }
};
Visible
Gets or sets the visibility of the user handle.By default, it is true.
Declaration
public bool Visible { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | true, which means the user handle is in visible state; Otherwise, false. |
Examples
UserHandle = new UserHandle()
{
Name = "user1",
ID="user2",
Displacement= 10,
};
VisibleTarget
Gets or sets whether the Userhandle is for Node, Connector or RuberBandSelection.
Declaration
public VisibleTarget VisibleTarget { get; set; }
Property Value
Type | Description |
---|---|
VisibleTarget | The Default of the VisibleTarget is Node |
Examples
UserHandle cloneHandle = new UserHandle()
{
Name = "clone",
Offset = 0,
Visible = true,
VisibleTarget = VisibleTarget.Node;
Side = Direction.Top,
Margin = new DiagramThickness { Top = 0, Bottom = 0, Left = 0, Right = 0 },
};
Methods
Clone()
Creates a new user handle that is a copy of the current user handle.
Declaration
public override object Clone()
Returns
Type |
---|
System.Object |