Class CellMarginsInfo
Provides a StyleInfoSubObjectBase object for margins in a cell. Each margin side of the cell can be configured individually with a System.Windows.Thickness value. Margin sides that have not been initialized will inherit default values from a base style.
Implements
Inherited Members
Namespace: Syncfusion.Windows.Controls.Cells
Assembly: Syncfusion.GridCommon.WPF.dll
Syntax
public class CellMarginsInfo : StyleInfoSubObjectBase, IStyleInfo, ISupportInitialize, IFormattable, IConvertible, IXmlSerializable, IStyleInfoSubObject, IDisposable
Examples
The following code changes margin information for cells:
Thickness margins = new Thickness(1, 1, 2, 2);
model[rowIndex, colIndex].BorderMargins = new CellMarginsInfo(margins);
model[rowIndex, colIndex+1].BorderMargins.Right = 2;
model[rowIndex, colIndex+1].BorderMargins.Left = 2;
Constructors
CellMarginsInfo()
Initializes a new empty CellMarginsInfo object.
Declaration
public CellMarginsInfo()
CellMarginsInfo(StyleInfoSubObjectIdentity)
Initalizes a new CellMarginsInfo object and associates it with an existing CachedStyleInfoSubObjectIdentity.
Declaration
public CellMarginsInfo(StyleInfoSubObjectIdentity identity)
Parameters
| Type | Name | Description |
|---|---|---|
| StyleInfoSubObjectIdentity | identity | A CachedStyleInfoSubObjectIdentity that holds the indentity for this CellMarginsInfo. |
CellMarginsInfo(StyleInfoSubObjectIdentity, CellMarginsInfoStore)
Initalizes a new CellMarginsInfo object and associates it with an existing CachedStyleInfoSubObjectIdentity.
Declaration
public CellMarginsInfo(StyleInfoSubObjectIdentity identity, CellMarginsInfoStore store)
Parameters
| Type | Name | Description |
|---|---|---|
| StyleInfoSubObjectIdentity | identity | A CachedStyleInfoSubObjectIdentity that holds the indentity for this CellMarginsInfo. A CellMarginsInfoStore that holds data for this CellMarginsInfo. All changes in this style object will saved in the CellMarginsInfoStore object. |
| CellMarginsInfoStore | store |
CellMarginsInfo(Double)
Initializes a new empty CellMarginsInfo object with default value applied.
Declaration
public CellMarginsInfo(double value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Double | value |
CellMarginsInfo(Double, Double, Double, Double)
Initializes a CellMarginsInfo and saves left, top, right and bottom margins.
Declaration
public CellMarginsInfo(double left, double top, double right, double bottom)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Double | left | Left margin. |
| System.Double | top | The top margin. |
| System.Double | right | The right margin. |
| System.Double | bottom | The bottom margin. |
CellMarginsInfo(Thickness)
Initializes a CellMarginsInfo and copies settings from a System.Windows.Thickness object.
Declaration
public CellMarginsInfo(Thickness margins)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.Thickness | margins |
Properties
Bottom
The bottom margin
Declaration
public double Bottom { get; set; }
Property Value
| Type |
|---|
| System.Double |
Default
Returns a default CellMarginsInfo to be used with a default style.
Declaration
public static CellMarginsInfo Default { get; }
Property Value
| Type |
|---|
| CellMarginsInfo |
Empty
Returns a empty CellMarginsInfo.
Declaration
public static CellMarginsInfo Empty { get; }
Property Value
| Type |
|---|
| CellMarginsInfo |
HasBottom
Determines if the bottom margin has been initialized.
Declaration
public bool HasBottom { get; }
Property Value
| Type |
|---|
| System.Boolean |
HasLeft
Determines if the left margin has been initialized.
Declaration
public bool HasLeft { get; }
Property Value
| Type |
|---|
| System.Boolean |
HasRight
Determines if the right margin has been initialized.
Declaration
public bool HasRight { get; }
Property Value
| Type |
|---|
| System.Boolean |
HasTop
Determines if the top margin has been initialized.
Declaration
public bool HasTop { get; }
Property Value
| Type |
|---|
| System.Boolean |
Left
The left margin
Declaration
public double Left { get; set; }
Property Value
| Type |
|---|
| System.Double |
Right
The right margin
Declaration
public double Right { get; set; }
Property Value
| Type |
|---|
| System.Double |
Top
The top margin
Declaration
public double Top { get; set; }
Property Value
| Type |
|---|
| System.Double |
Methods
CreateObject(StyleInfoSubObjectIdentity, Object)
Creates the CellMarginsInfo object.
Declaration
public static object CreateObject(StyleInfoSubObjectIdentity identity, object store)
Parameters
| Type | Name | Description |
|---|---|---|
| StyleInfoSubObjectIdentity | identity | The identity. |
| System.Object | store | The store. |
Returns
| Type |
|---|
| System.Object |
GetDefaultStyle()
Declaration
protected override StyleInfoBase GetDefaultStyle()
Returns
| Type |
|---|
| StyleInfoBase |
Overrides
MakeCopy(StyleInfoBase, StyleInfoProperty)
Declaration
public override IStyleInfoSubObject MakeCopy(StyleInfoBase newOwner, StyleInfoProperty sip)
Parameters
| Type | Name | Description |
|---|---|---|
| StyleInfoBase | newOwner | |
| StyleInfoProperty | sip |
Returns
| Type |
|---|
| IStyleInfoSubObject |
Overrides
ResetBottom()
Resets the bottom margin
Declaration
public void ResetBottom()
ResetLeft()
Resets the left margin
Declaration
public void ResetLeft()
ResetRight()
Resets the right margin
Declaration
public void ResetRight()
ResetTop()
Resets the top margin
Declaration
public void ResetTop()
ToThickness()
Converts this object to a System.Windows.Thickness object.
Declaration
public Thickness ToThickness()
Returns
| Type | Description |
|---|---|
| System.Windows.Thickness | A System.Windows.Thickness object filled with the current objects settings. |
ToThickness(CellMarginsInfo)
Creates a System.Windows.Thickness object comibing margins.
Declaration
public Thickness ToThickness(CellMarginsInfo other)
Parameters
| Type | Name | Description |
|---|---|---|
| CellMarginsInfo | other |
Returns
| Type | Description |
|---|---|
| System.Windows.Thickness | A System.Windows.Thickness object filled with the current objects settings. |
Explicit Interface Implementations
IDisposable.Dispose()
Declaration
void IDisposable.Dispose()