RichTextKit v0.2

StyleManager Class

Assembly: Topten.RichTextKit.dll
Namespace: Topten.RichTextKit

Helper class for managing RichTextKit styles.

public class StyleManager

Inheritance

StyleManager → object

Remarks

The StyleManager can be used to simplify the creation of styles by maintaining a current style that incremental changes can be made to.

eg: turn bold on, underline off, change font family etc...

The StyleManager also implements an internal stack to simplify applying a particular style and then popping back to the previous style.

Constructors

StyleManager()

Constructs a new StyleManager

Fields

Default

The default style manager instance

Properties

CurrentStyle

The current style

DefaultStyle

The default style to be be used when Reset is called

Methods

Bold(bool)

Changes the font weight and returns an update IStyle (short cut to FontWeight)

FontFamily(string)

Changes the font family and returns an updated IStyle

FontItalic(bool)

Changes the font italic setting and returns an updated IStyle

FontSize(float)

Changes the font size and returns an updated IStyle

FontVariant(FontVariant)

Changes the font variant and returns an updated IStyle

FontWeight(int)

Changes the font weight and returns an updated IStyle

FromStyle(IStyle)

Get a style that matches all the style attributes of the supplied style

LetterSpacing(float)

Changes the character spacing and returns an updated IStyle

LineHeight(float)

Changes the line height and returns an updated IStyle

Pop()

Restores the current state on an internal stack

Push()

Saves the current state on an internal stack

Reset()

Resets the current style to the default style and resets the internal Push/Pop style stack to empty.

StrikeThrough(StrikeThroughStyle)

Changes the strikethrough style and returns an updated IStyle

TextColor(SkiaSharp.SKColor)

Changes the text color and returns an updated IStyle

TextDirection(TextDirection)

Changes the text direction and returns an updated IStyle

Underline(UnderlineStyle)

Changes the underline style and returns an updated IStyle

Update(string, Nullable<float>, Nullable<int>, Nullable<bool>, Nullable<UnderlineStyle>, Nullable<StrikeThroughStyle>, Nullable<float>, Nullable<SkiaSharp.SKColor>, Nullable<float>, Nullable<FontVariant>, Nullable<TextDirection>)

Update the current style by applying one or more changes to the current style.

Subscribe for more like this. No spam, just fun tech stuff :)