# OdfStyle

An XML-backed common or automatic ODF style.

Class 

`OfficeIMO.OpenDocument`

**Namespace**

`OfficeIMO.OpenDocument`

**Assembly**

`OfficeIMO.OpenDocument`

**Source revision**

`be6c300e4ab1` with working tree changes

**Source**

[OdfStyle.cs:42](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OpenDocument/Styles/OdfStyle.cs#L42)

**Modifiers**

sealed

An XML-backed common or automatic ODF style.

## Inheritance

- object
- OdfStyle

## Usage

Explore 9 API references to this type

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

### Returned or exposed by 7

- Method [OdfStyleRepository.CreateAutomatic](/api/open-document/officeimo-opendocument-odfstylerepository/#method-createautomatic-officeimo-opendocument-odfstylefamily-string-string)
- Method [OdfStyleRepository.CreateNamed](/api/open-document/officeimo-opendocument-odfstylerepository/#method-createnamed-string-officeimo-opendocument-odfstylefamily-string)
- Method [OdfStyleRepository.Find](/api/open-document/officeimo-opendocument-odfstylerepository/#method-find-officeimo-opendocument-odfstylefamily-string)
- Method [OdfStyleRepository.Resolve](/api/open-document/officeimo-opendocument-odfstylerepository/#method-resolve-officeimo-opendocument-odfstyle)
- Property [OdfStyleRepository.Automatic](/api/open-document/officeimo-opendocument-odfstylerepository/#property-automatic)
- Property [OdfStyleRepository.Named](/api/open-document/officeimo-opendocument-odfstylerepository/#property-named)
- Property [OdfTabStop.LeaderTextStyle](/api/open-document/officeimo-opendocument-odftabstop/#property-leadertextstyle)

### Accepted by parameters 2

- Method [OdfStyleRepository.Resolve](/api/open-document/officeimo-opendocument-odfstylerepository/#method-resolve-officeimo-opendocument-odfstyle) parameter `style`
- Method [OdfTabStop.WithLeaderTextStyle](/api/open-document/officeimo-opendocument-odftabstop/#method-withleadertextstyle-officeimo-opendocument-odfstyle) parameter `style`

Filter members 

Show inherited

## Methods

`public OdfStyleMap AddConditionalMap(string condition, string applyStyleName, string? baseCellAddress = null)` [#](#method-addconditionalmap-string-string-string)

[OdfStyle.cs:42](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OpenDocument/Styles/OdfStyle.cs#L42)

Adds a native ODF conditional style mapping.

Parameters

**condition string required**

**applyStyleName string required**

**baseCellAddress string? = null optional**

Returns

`OdfStyleMap`

## Inherited Methods

`public virtual bool Equals(object? obj)` [#](#method-equals-object)

Inherited from object

Parameters

**obj object? required**

Returns

`bool`

`public virtual int GetHashCode()` [#](#method-gethashcode)

Inherited from object

Returns

`int`

`public Type GetType()` [#](#method-gettype)

Inherited from object

Returns

`Type`

`public virtual string? ToString()` [#](#method-tostring)

Inherited from object

Returns

`string?`

## Properties

`public string Name { get; }` [#](#property-name)

[OdfStyle.cs:16](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OpenDocument/Styles/OdfStyle.cs#L16)

Style name.

`public OdfStyleFamily Family { get; }` [#](#property-family)

[OdfStyle.cs:20](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OpenDocument/Styles/OdfStyle.cs#L20)

Style family.

`public string? ParentStyleName { get; set; }` [#](#property-parentstylename)

[OdfStyle.cs:28](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OpenDocument/Styles/OdfStyle.cs#L28)

Optional parent style name.

`public bool IsAutomatic { get; }` [#](#property-isautomatic)

[OdfStyle.cs:35](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OpenDocument/Styles/OdfStyle.cs#L35)

True for an automatic style.

`public IReadOnlyList<OdfStyleMap> ConditionalMaps { get; }` [#](#property-conditionalmaps)

[OdfStyle.cs:37](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OpenDocument/Styles/OdfStyle.cs#L37)

Conditional style mappings in their authored evaluation order.

`public string? DataStyleName { get; set; }` [#](#property-datastylename)

[OdfStyle.cs:55](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OpenDocument/Styles/OdfStyle.cs#L55)

Referenced number, currency, percentage, date, or time data style.

`public bool? Bold { get; set; }` [#](#property-bold)

[OdfStyle.cs:60](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OpenDocument/Styles/OdfStyle.cs#L60)

True when bold text is explicitly enabled by this style.

`public bool? Italic { get; set; }` [#](#property-italic)

[OdfStyle.cs:65](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OpenDocument/Styles/OdfStyle.cs#L65)

True when italic text is explicitly enabled by this style.

`public bool? Underline { get; set; }` [#](#property-underline)

[OdfStyle.cs:70](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OpenDocument/Styles/OdfStyle.cs#L70)

True when text underline is explicitly enabled by this style.

`public OdfTextDecorationStyle? UnderlineStyle { get; set; }` [#](#property-underlinestyle)

[OdfStyle.cs:80](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OpenDocument/Styles/OdfStyle.cs#L80)

Explicit native ODF underline line style.

`public OdfTextDecorationType? UnderlineType { get; set; }` [#](#property-underlinetype)

[OdfStyle.cs:86](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OpenDocument/Styles/OdfStyle.cs#L86)

Explicit native ODF underline line count.

`public bool? UsesNonSolidUnderlineStyle { get; }` [#](#property-usesnonsolidunderlinestyle)

[OdfStyle.cs:91](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OpenDocument/Styles/OdfStyle.cs#L91)

Whether this style explicitly uses an underline variant other than solid or none.

`public bool? Strikethrough { get; set; }` [#](#property-strikethrough)

[OdfStyle.cs:95](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OpenDocument/Styles/OdfStyle.cs#L95)

True when text strike-through is explicitly enabled by this style.

`public OdfTextDecorationStyle? LineThroughStyle { get; set; }` [#](#property-linethroughstyle)

[OdfStyle.cs:105](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OpenDocument/Styles/OdfStyle.cs#L105)

Explicit native ODF line-through style.

`public OdfTextDecorationType? LineThroughType { get; set; }` [#](#property-linethroughtype)

[OdfStyle.cs:111](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OpenDocument/Styles/OdfStyle.cs#L111)

Explicit native ODF line-through count.

`public bool? UsesNonSolidLineThroughStyle { get; }` [#](#property-usesnonsolidlinethroughstyle)

[OdfStyle.cs:116](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OpenDocument/Styles/OdfStyle.cs#L116)

Whether this style explicitly uses a line-through variant other than solid or none.

`public OdfLength? FontSize { get; set; }` [#](#property-fontsize)

[OdfStyle.cs:120](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OpenDocument/Styles/OdfStyle.cs#L120)

Explicit font size.

`public string? TextPositionValue { get; set; }` [#](#property-textpositionvalue)

[OdfStyle.cs:125](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OpenDocument/Styles/OdfStyle.cs#L125)

Exact ODF style:text-position value, including authored percentages.

`public OdfTextPosition? TextPosition { get; set; }` [#](#property-textposition)

[OdfStyle.cs:131](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OpenDocument/Styles/OdfStyle.cs#L131)

Common native ODF baseline placement.

`public OdfTextTransform? TextTransform { get; set; }` [#](#property-texttransform)

[OdfStyle.cs:142](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OpenDocument/Styles/OdfStyle.cs#L142)

Native ODF display-time case transformation.

`public bool? SmallCaps { get; set; }` [#](#property-smallcaps)

[OdfStyle.cs:148](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OpenDocument/Styles/OdfStyle.cs#L148)

Native ODF small-cap display formatting.

`public string? FontFamily { get; set; }` [#](#property-fontfamily)

[OdfStyle.cs:155](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OpenDocument/Styles/OdfStyle.cs#L155)

Explicit font family.

`public OdfColor? Color { get; set; }` [#](#property-color)

[OdfStyle.cs:166](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OpenDocument/Styles/OdfStyle.cs#L166)

Explicit text color.

`public double? TextOpacity { get; set; }` [#](#property-textopacity)

[OdfStyle.cs:176](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OpenDocument/Styles/OdfStyle.cs#L176)

Explicit text opacity from zero to one. Null means no declaration in this style.

Exceptions

- `InvalidDataException` – An imported declaration is invalid or its aliases conflict.
- `ArgumentOutOfRangeException` – The assigned value is not finite or is outside zero to one.

`public OdfColor? TextBackgroundColor { get; set; }` [#](#property-textbackgroundcolor)

[OdfStyle.cs:187](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OpenDocument/Styles/OdfStyle.cs#L187)

Explicit text background color, commonly used for highlighting.

`public OdfColor? BackgroundColor { get; set; }` [#](#property-backgroundcolor)

[OdfStyle.cs:195](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OpenDocument/Styles/OdfStyle.cs#L195)

Explicit cell or paragraph background color.

`public string? BreakBefore { get; set; }` [#](#property-breakbefore)

[OdfStyle.cs:207](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OpenDocument/Styles/OdfStyle.cs#L207)

Explicit paragraph break-before value.

`public string? TextAlign { get; set; }` [#](#property-textalign)

[OdfStyle.cs:212](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OpenDocument/Styles/OdfStyle.cs#L212)

Explicit horizontal paragraph alignment.

`public string? CellTextAlignSource { get; set; }` [#](#property-celltextalignsource)

[OdfStyle.cs:222](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OpenDocument/Styles/OdfStyle.cs#L222)

Whether table-cell horizontal alignment is fixed or follows the value type.

`public string? CellVerticalAlign { get; set; }` [#](#property-cellverticalalign)

[OdfStyle.cs:229](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OpenDocument/Styles/OdfStyle.cs#L229)

Explicit table-cell vertical alignment token.

`public string? CellWrapOption { get; set; }` [#](#property-cellwrapoption)

[OdfStyle.cs:236](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OpenDocument/Styles/OdfStyle.cs#L236)

Explicit table-cell text wrapping token.

`public string? WritingMode { get; set; }` [#](#property-writingmode)

[OdfStyle.cs:243](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OpenDocument/Styles/OdfStyle.cs#L243)

Explicit ODF paragraph writing-mode token.

`public OdfLength? LineHeight { get; set; }` [#](#property-lineheight)

[OdfStyle.cs:248](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OpenDocument/Styles/OdfStyle.cs#L248)

Explicit paragraph line height, including absolute and percentage values.

`public OdfLength? MarginLeft { get; set; }` [#](#property-marginleft)

[OdfStyle.cs:253](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OpenDocument/Styles/OdfStyle.cs#L253)

Explicit paragraph start margin.

`public OdfLength? MarginRight { get; set; }` [#](#property-marginright)

[OdfStyle.cs:258](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OpenDocument/Styles/OdfStyle.cs#L258)

Explicit paragraph end margin.

`public OdfLength? MarginTop { get; set; }` [#](#property-margintop)

[OdfStyle.cs:263](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OpenDocument/Styles/OdfStyle.cs#L263)

Explicit paragraph top margin.

`public OdfLength? MarginBottom { get; set; }` [#](#property-marginbottom)

[OdfStyle.cs:268](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OpenDocument/Styles/OdfStyle.cs#L268)

Explicit paragraph bottom margin.

`public OdfLength? TextIndent { get; set; }` [#](#property-textindent)

[OdfStyle.cs:273](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OpenDocument/Styles/OdfStyle.cs#L273)

Explicit first-line paragraph indentation.

<!-- PowerForge markdown artifact sha256:8C4CB85D8BA5FBA5169E559071DB23F71D1A1A96D8DA04684C604A8115393024 -->
