Class TreeStyleInfo
Maintains appearance and value for a cell in a VirtualTreeView. The style object also provides shortcut properties to access the TreeModel, TreeNode, Column, Level and CellRowColumnIndex the cell style represents.
Implements
Inherited Members
Namespace: Syncfusion.Windows.Controls.VirtualTreeView
Assembly: Syncfusion.GridCommon.WPF.dll
Syntax
public class TreeStyleInfo : StyleInfoBase, IDisposable, IStyleInfo, ISupportInitialize, IFormattable, IConvertible, IXmlSerializable, IRenderCellInfo
Constructors
TreeStyleInfo()
Initalizes a new style object.
Declaration
public TreeStyleInfo()
TreeStyleInfo(TreeStyleInfo)
Initalizes a new style object and copies all data from an existing style object.
Declaration
public TreeStyleInfo(TreeStyleInfo style)
Parameters
| Type | Name | Description |
|---|---|---|
| TreeStyleInfo | style | The style object that contains the original data. |
TreeStyleInfo(TreeStyleInfoStore)
Initalizes a new style object and associates it with an existing TreeStyleInfoStore.
Declaration
public TreeStyleInfo(TreeStyleInfoStore store)
Parameters
| Type | Name | Description |
|---|---|---|
| TreeStyleInfoStore | store | A TreeStyleInfoStore that holds data for this TreeStyleInfo. All changes in this style object will be saved in the TreeStyleInfoStore object. |
TreeStyleInfo(StyleInfoIdentityBase)
Initalizes a new style object and associates it with an existing TreeStyleInfoIdentity.
Declaration
public TreeStyleInfo(StyleInfoIdentityBase identity)
Parameters
| Type | Name | Description |
|---|---|---|
| StyleInfoIdentityBase | identity | A TreeStyleInfoIdentity that holds the indentity for this TreeStyleInfo. |
TreeStyleInfo(StyleInfoIdentityBase, TreeStyleInfoStore)
Initalizes a new style object and associates it with an existing TreeStyleInfoIdentity.
Declaration
public TreeStyleInfo(StyleInfoIdentityBase identity, TreeStyleInfoStore store)
Parameters
| Type | Name | Description |
|---|---|---|
| StyleInfoIdentityBase | identity | A TreeStyleInfoIdentity that holds the indentity for this TreeStyleInfo. |
| TreeStyleInfoStore | store | A TreeStyleInfoStore that holds data for this TreeStyleInfo. All changes in this style object will be saved in the TreeStyleInfoStore object. |
Fields
Empty
An empty style object.
Declaration
public static readonly TreeStyleInfo Empty
Field Value
| Type |
|---|
| TreeStyleInfo |
Properties
Background
Gets or sets the background.
Declaration
public Brush Background { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Windows.Media.Brush | The background. |
BorderMargins
Gets or sets the border margins.
Declaration
public CellMarginsInfo BorderMargins { get; set; }
Property Value
| Type | Description |
|---|---|
| CellMarginsInfo | The border margins. |
Borders
Gets or sets the borders.
Declaration
public CellBordersInfo Borders { get; set; }
Property Value
| Type | Description |
|---|---|
| CellBordersInfo | The borders. |
CellRenderer
Gets or sets the cell renderer.
Declaration
public TreeCellRenderer CellRenderer { get; set; }
Property Value
| Type | Description |
|---|---|
| Syncfusion.Windows.Controls.VirtualTreeView.TreeCellRenderer | The cell renderer. |
CellRowColumnIndex
Gets the index of the cell row column.
Declaration
public RowColumnIndex CellRowColumnIndex { get; }
Property Value
| Type | Description |
|---|---|
| RowColumnIndex | The index of the cell row column. |
CellTemplate
Gets or sets the cell template.
Declaration
public DataTemplate CellTemplate { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Windows.DataTemplate | The cell template. |
CellTemplateKey
Gets or sets the cell template key.
Declaration
public string CellTemplateKey { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String | The cell template key. |
CellValue
Gets or sets the cell value.
Declaration
public object CellValue { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Object | The cell value. |
CellValueType
Gets or sets the type of the cell value.
Declaration
public Type CellValueType { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Type | The type of the cell value. |
Column
Gets the column.
Declaration
public TreeColumn Column { get; }
Property Value
| Type | Description |
|---|---|
| TreeColumn | The column. |
ColumnIndex
Gets the index of the column.
Declaration
public int ColumnIndex { get; }
Property Value
| Type | Description |
|---|---|
| System.Int32 | The index of the column. |
CultureInfo
Gets or sets the culture info.
Declaration
[CloneableProperty(false)]
[DisposeableProperty(false)]
public CultureInfo CultureInfo { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Globalization.CultureInfo | The culture info. |
Default
Gets the default style settings.
Declaration
public static TreeStyleInfo Default { get; }
Property Value
| Type | Description |
|---|---|
| TreeStyleInfo | The default. |
Format
Gets or sets the format.
Declaration
public string Format { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String | The format. |
FormattedText
Gets or sets the formatted text.
Declaration
public string FormattedText { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String | The formatted text. |
HasBackground
Determines if Background has been initialized for the current object.
Declaration
public bool HasBackground { get; }
Property Value
| Type |
|---|
| System.Boolean |
HasBorderMargins
Determines if BorderMargins has been initialized for the current object.
Declaration
public bool HasBorderMargins { get; }
Property Value
| Type |
|---|
| System.Boolean |
HasBorders
Determines if border information has been initialized for the current object.
Declaration
public bool HasBorders { get; }
Property Value
| Type |
|---|
| System.Boolean |
HasCellRenderer
Determines if CellRenderer has been initialized for the current object.
Declaration
public bool HasCellRenderer { get; }
Property Value
| Type |
|---|
| System.Boolean |
HasCellTemplate
Determines if CellTemplate has been initialized for the current object.
Declaration
public bool HasCellTemplate { get; }
Property Value
| Type |
|---|
| System.Boolean |
HasCellTemplateKey
Determines if CellTemplateKey has been initialized for the current object.
Declaration
public bool HasCellTemplateKey { get; }
Property Value
| Type |
|---|
| System.Boolean |
HasCellValue
Determines if CellValue has been initialized for the current object.
Declaration
public bool HasCellValue { get; }
Property Value
| Type |
|---|
| System.Boolean |
HasCellValueType
Determines if CellValueType has been initialized for the current object.
Declaration
public bool HasCellValueType { get; }
Property Value
| Type |
|---|
| System.Boolean |
HasCultureInfo
Determines if CultureInfo has been initialized for the current object.
Declaration
public bool HasCultureInfo { get; }
Property Value
| Type |
|---|
| System.Boolean |
HasFormat
Determines if Format has been initialized for the current object.
Declaration
public bool HasFormat { get; }
Property Value
| Type |
|---|
| System.Boolean |
Level
Gets the level.
Declaration
public TreeLevel Level { get; }
Property Value
| Type | Description |
|---|---|
| TreeLevel | The level. |
ReadOnlyBorderMargins
Declaration
public CellMarginsInfo ReadOnlyBorderMargins { get; }
Property Value
| Type |
|---|
| CellMarginsInfo |
ReadOnlyBorders
Declaration
public CellBordersInfo ReadOnlyBorders { get; }
Property Value
| Type |
|---|
| CellBordersInfo |
RowIndex
Gets the index of the row.
Declaration
public int RowIndex { get; }
Property Value
| Type | Description |
|---|---|
| System.Int32 | The index of the row. |
Store
The TreeStyleInfoStore object that holds all the data for this style object.
Declaration
public TreeStyleInfoStore Store { get; }
Property Value
| Type |
|---|
| TreeStyleInfoStore |
Text
Gets or sets the text.
Declaration
public string Text { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String | The text. |
TreeModel
Gets the tree model.
Declaration
public TreeModel TreeModel { get; }
Property Value
| Type | Description |
|---|---|
| TreeModel | The tree model. |
TreeNode
Gets the tree node.
Declaration
public TreeNode TreeNode { get; }
Property Value
| Type | Description |
|---|---|
| TreeNode | The tree node. |
TreeNodeIdentity
Holds identity information such as row and column index for the current TreeStyleInfo.
Declaration
public TreeStyleInfoIdentity TreeNodeIdentity { get; set; }
Property Value
| Type |
|---|
| TreeStyleInfoIdentity |
Methods
ApplyFormattedText(String)
Parses the formatted text using Format and cell value type information stored in the current style object. The text is parsed using TreeStyleInfo.CultureInfo information.
Declaration
public bool ApplyFormattedText(string text)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | text | The formatted text. |
Returns
| Type | Description |
|---|---|
| System.Boolean | True if the text could be parsed correctly and converted to a cell value. |
ApplyText(String)
Parses the text (ignoring any Format settings) and assigns it to CellValue. The text is parsed using CultureInfo.CurrentCulture information.
Declaration
public bool ApplyText(string text)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | text | The text to be parsed. |
Returns
| Type | Description |
|---|---|
| System.Boolean | True if the text could be parsed correctly and converted to a cell value. |
CreateSubObjectIdentity(StyleInfoProperty)
Override this method to create a product-specific identity object for a sub object.
Declaration
public override StyleInfoSubObjectIdentity CreateSubObjectIdentity(StyleInfoProperty sip)
Parameters
| Type | Name | Description |
|---|---|---|
| StyleInfoProperty | sip |
Returns
| Type | Description |
|---|---|
| StyleInfoSubObjectIdentity | An identity object for a subobject of this style. |
Overrides
Examples
The following code is an example how Essential Grid creates GridStyleInfoSubObjectIdentity:
public override StyleInfoSubObjectIdentity CreateSubObjectIdentity(StyleInfoProperty sip)
{
return new CachedStyleInfoSubObjectIdentity(this, sip);
}
GetCulture(Boolean)
Gets the culture information from the style object or returns CultureInfo.CurrentCulture if CultureInfo is NULL.
Declaration
public CultureInfo GetCulture(bool useCurrentCultureIfNull)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Boolean | useCurrentCultureIfNull | True if CultureInfo.CurrentUICulture should be returned when CultureInfo is NULL. |
Returns
| Type | Description |
|---|---|
| System.Globalization.CultureInfo | The culture information with rules for parsing and formatting the cell's value. |
GetDefaultStyle()
Override this method to return a default style object for your derived class.
Declaration
protected override StyleInfoBase GetDefaultStyle()
Returns
| Type | Description |
|---|---|
| StyleInfoBase | A default style object. |
Overrides
Remarks
You should cache the default style object in a static field.
GetFormattedText(Object)
Return formatted text for the specified value.
Declaration
public string GetFormattedText(object value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | value | The value to be formatted. |
Returns
| Type | Description |
|---|---|
| System.String | A string that holds the formatted text. |
GetText(Object)
Returns text for the specified value (ignoring any Format settings). CultureInfo.CurrentCulture is used for conversion to string.
Declaration
public string GetText(object value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | value | The value to be converted to string. |
Returns
| Type | Description |
|---|---|
| System.String | A string that represents the value. |
ResetBackground()
Resets Background.
Declaration
public void ResetBackground()
ResetBorderMargins()
Resets BorderMargins.
Declaration
public void ResetBorderMargins()
ResetBorders()
Resets the borders information.
Declaration
public void ResetBorders()
ResetCellRenderer()
Resets CellRenderer.
Declaration
public void ResetCellRenderer()
ResetCellTemplate()
Resets CellTemplate.
Declaration
public void ResetCellTemplate()
ResetCellTemplateKey()
Resets CellTemplateKey.
Declaration
public void ResetCellTemplateKey()
ResetCellValue()
Resets CellValue.
Declaration
public void ResetCellValue()
ResetCellValueType()
Resets CellValueType.
Declaration
public void ResetCellValueType()
ResetCultureInfo()
Resets CultureInfo.
Declaration
public void ResetCultureInfo()
ResetFormat()
Resets Format.
Declaration
public void ResetFormat()
Explicit Interface Implementations
IRenderCellInfo.CanCombineCellBackground(IRenderCellInfo)
Declaration
bool IRenderCellInfo.CanCombineCellBackground(IRenderCellInfo other)
Parameters
| Type | Name | Description |
|---|---|---|
| IRenderCellInfo | other |
Returns
| Type |
|---|
| System.Boolean |
IRenderCellInfo.CanCombineCellBorder(CellBorderSide, IRenderCellInfo)
Declaration
bool IRenderCellInfo.CanCombineCellBorder(CellBorderSide side, IRenderCellInfo other)
Parameters
| Type | Name | Description |
|---|---|---|
| CellBorderSide | side | |
| IRenderCellInfo | other |
Returns
| Type |
|---|
| System.Boolean |
IRenderCellInfo.GetBorderMargins()
Declaration
Thickness IRenderCellInfo.GetBorderMargins()
Returns
| Type |
|---|
| System.Windows.Thickness |
IRenderCellInfo.GetCellBackground()
Declaration
object IRenderCellInfo.GetCellBackground()
Returns
| Type |
|---|
| System.Object |
IRenderCellInfo.GetCellBorder(CellBorderSide)
Declaration
object IRenderCellInfo.GetCellBorder(CellBorderSide side)
Parameters
| Type | Name | Description |
|---|---|---|
| CellBorderSide | side |
Returns
| Type |
|---|
| System.Object |
IRenderCellInfo.GetPadding()
Declaration
Thickness IRenderCellInfo.GetPadding()
Returns
| Type |
|---|
| System.Windows.Thickness |