Class SymbolMargin
Gets or sets the extra space around the outer boundaries of the symbol.
Inheritance
Namespace: Syncfusion.Blazor.Diagram.SymbolPalette
Assembly: Syncfusion.Blazor.dll
Syntax
public class SymbolMargin : Object, IPaletteObject, IDiagramObject, ICloneable
Remarks
Use this property to control the spacing between symbols and their container boundaries.
Examples
<SfSymbolPaletteComponent SymbolMargin="@SymbolMargin" SymbolHeight="50">
</SfSymbolPaletteComponent>
@code {
SymbolMargin SymbolMargin = new SymbolMargin
{
Left = 10,
Right = 10,
Top = 10,
Bottom = 10
};
}
Constructors
SymbolMargin()
Declaration
public SymbolMargin()
Properties
Bottom
Gets or sets the extra space at the bottom of the symbol.
Declaration
public double Bottom { get; set; }
Property Value
Type | Description |
---|---|
System.Double | A double value representing the bottom margin in pixels. The default value is 0. |
Examples
<SfSymbolPaletteComponent SymbolMargin="@SymbolMargin" SymbolHeight="50">
</SfSymbolPaletteComponent>
@code {
SymbolMargin SymbolMargin = new SymbolMargin
{
Left = 10,
Right = 10,
Top = 10,
Bottom = 15 // Bottom margin
};
}
Left
Gets or sets the extra space at the left of the symbol.
Declaration
public double Left { get; set; }
Property Value
Type | Description |
---|---|
System.Double | A double value representing the left margin in pixels. The default value is 0. |
Examples
<SfSymbolPaletteComponent SymbolMargin="@SymbolMargin" SymbolHeight="50">
</SfSymbolPaletteComponent>
@code {
SymbolMargin SymbolMargin = new SymbolMargin
{
Left = 15, // Left margin
Right = 10,
Top = 10,
Bottom = 10
};
}
Right
Gets or sets the extra space at the right of the symbol.
Declaration
public double Right { get; set; }
Property Value
Type | Description |
---|---|
System.Double | A double value representing the right margin in pixels. The default value is 0. |
Examples
<SfSymbolPaletteComponent SymbolMargin="@SymbolMargin" SymbolHeight="50">
</SfSymbolPaletteComponent>
@code {
SymbolMargin SymbolMargin = new SymbolMargin
{
Left = 10,
Right = 15, // Right margin
Top = 10,
Bottom = 10
};
}
Top
Gets or sets the extra space at the top of the symbol.
Declaration
public double Top { get; set; }
Property Value
Type | Description |
---|---|
System.Double | A double value representing the top margin in pixels. The default value is 0. |
Examples
<SfSymbolPaletteComponent SymbolMargin="@SymbolMargin" SymbolHeight="50">
</SfSymbolPaletteComponent>
@code {
SymbolMargin SymbolMargin = new SymbolMargin
{
Left = 10,
Right = 10,
Top = 15, // Top margin
Bottom = 10
};
}
Methods
Clone()
Creates a new SymbolMargin that is a copy of the current SymbolMargin.
Declaration
public object Clone()
Returns
Type | Description |
---|---|
System.Object | A new SymbolMargin instance that is a deep copy of the current instance. |
Remarks
This method performs a deep copy, creating a new instance with identical property values.
OnPropertyChanged(String, Object, Object, IDiagramObject)
Invoked when the effective value of any property on this Symbol margin has been updated.
Declaration
public void OnPropertyChanged(string propertyName, object newVal, object oldVal, IDiagramObject container)
Parameters
Type | Name | Description |
---|---|---|
System.String | propertyName | A string that contains the name of the property that was updated. |
System.Object | newVal | An object that contains the new value of the property. |
System.Object | oldVal | An object that contains the previous value of the property. |
IDiagramObject | container | An IDiagramObject that contains the diagram object. |
Remarks
This method is called internally to handle property value changes and notify relevant components.
OnPropertyChanged(String, Object, Object, IPaletteObject)
Invoked when the effective value of any property on this Symbol margin has been updated.
Declaration
public void OnPropertyChanged(string propertyName, object newVal, object oldVal, IPaletteObject container)
Parameters
Type | Name | Description |
---|---|---|
System.String | propertyName | A string that contains the name of the property that was updated. |
System.Object | newVal | An object that contains the new value of the property. |
System.Object | oldVal | An object that contains the previous value of the property. |
IPaletteObject | container | An IPaletteObject that represents the palette object container. |
Remarks
This method is called internally to handle property value changes and notify relevant components.