Table of Contents

Class Stylesheet

Namespace
Myra.Graphics2D.UI.Styles
Assembly
Myra.dll

Manages a collection of UI styles used throughout the application. Provides access to default styles and named style variants for all UI widgets.

public class Stylesheet
Inheritance
Stylesheet
Inherited Members

Fields

DefaultStyleName

The default style identifier used when no specific style name is provided.

public const string DefaultStyleName = ""

Field Value

string

Properties

Atlas

Gets the texture atlas containing all texture regions used in the stylesheet. Skip load, since it is loaded manually

[XmlName("TextureRegionAtlas")]
public TextureRegionAtlas Atlas { get; }

Property Value

TextureRegionAtlas

ButtonStyle

Gets or sets the default style for button widgets.

public ButtonStyle ButtonStyle { get; set; }

Property Value

ButtonStyle

ButtonStyles

Gets the dictionary of named button styles, keyed by style identifier.

public Dictionary<string, ButtonStyle> ButtonStyles { get; }

Property Value

Dictionary<string, ButtonStyle>

CheckBoxStyle

Gets or sets the default style for checkbox widgets.

public CheckButtonStyle CheckBoxStyle { get; set; }

Property Value

CheckButtonStyle

CheckBoxStyles

Gets the dictionary of named checkbox styles, keyed by style identifier.

public Dictionary<string, CheckButtonStyle> CheckBoxStyles { get; }

Property Value

Dictionary<string, CheckButtonStyle>

ColorPickerDialogStyle

Gets or sets the default style for color picker dialog widgets.

public ColorPickerDialogStyle ColorPickerDialogStyle { get; set; }

Property Value

ColorPickerDialogStyle

ColorPickerDialogStyles

Gets the dictionary of named color picker dialog styles, keyed by style identifier.

public Dictionary<string, ColorPickerDialogStyle> ColorPickerDialogStyles { get; }

Property Value

Dictionary<string, ColorPickerDialogStyle>

ComboBoxStyle

Gets or sets the default style for combo box widgets.

public ComboBoxStyle ComboBoxStyle { get; set; }

Property Value

ComboBoxStyle

ComboBoxStyles

Gets the dictionary of named combo box styles, keyed by style identifier.

public Dictionary<string, ComboBoxStyle> ComboBoxStyles { get; }

Property Value

Dictionary<string, ComboBoxStyle>

Current

Gets or sets the current active stylesheet used globally. If not explicitly set, returns the default stylesheet from DefaultAssets.

public static Stylesheet Current { get; set; }

Property Value

Stylesheet

DataGridStyle

Gets or sets the default style applied to DataGrid widgets.

public DataGridStyle DataGridStyle { get; set; }

Property Value

DataGridStyle

DataGridStyles

Gets the dictionary of named DataGrid styles, keyed by style identifier.

public Dictionary<string, DataGridStyle> DataGridStyles { get; }

Property Value

Dictionary<string, DataGridStyle>

DesktopStyle

Gets or sets the style applied to the desktop background.

public DesktopStyle DesktopStyle { get; set; }

Property Value

DesktopStyle

FileDialogStyle

Gets or sets the default style for file dialog widgets.

public FileDialogStyle FileDialogStyle { get; set; }

Property Value

FileDialogStyle

FileDialogStyles

Gets the dictionary of named file dialog styles, keyed by style identifier.

public Dictionary<string, FileDialogStyle> FileDialogStyles { get; }

Property Value

Dictionary<string, FileDialogStyle>

Fonts

Gets the collection of fonts used in the stylesheet.

public StylesheetFontsCollection Fonts { get; }

Property Value

StylesheetFontsCollection

GridStyles

Gets the dictionary of named grid styles, keyed by style identifier.

public Dictionary<string, GridStyle> GridStyles { get; }

Property Value

Dictionary<string, GridStyle>

HorizontalMenuStyle

Gets or sets the default style for horizontal menu widgets.

public MenuStyle HorizontalMenuStyle { get; set; }

Property Value

MenuStyle

HorizontalMenuStyles

Gets the dictionary of named horizontal menu styles, keyed by style identifier.

public Dictionary<string, MenuStyle> HorizontalMenuStyles { get; }

Property Value

Dictionary<string, MenuStyle>

HorizontalProgressBarStyle

Gets or sets the default style for horizontal progress bar widgets.

public ProgressBarStyle HorizontalProgressBarStyle { get; set; }

Property Value

ProgressBarStyle

HorizontalProgressBarStyles

Gets the dictionary of named horizontal progress bar styles, keyed by style identifier.

public Dictionary<string, ProgressBarStyle> HorizontalProgressBarStyles { get; }

Property Value

Dictionary<string, ProgressBarStyle>

HorizontalSeparatorStyle

Gets or sets the default style for horizontal separator widgets.

public SeparatorStyle HorizontalSeparatorStyle { get; set; }

Property Value

SeparatorStyle

HorizontalSeparatorStyles

Gets the dictionary of named horizontal separator styles, keyed by style identifier.

public Dictionary<string, SeparatorStyle> HorizontalSeparatorStyles { get; }

Property Value

Dictionary<string, SeparatorStyle>

HorizontalSliderStyle

Gets or sets the default style for horizontal slider widgets.

public SliderStyle HorizontalSliderStyle { get; set; }

Property Value

SliderStyle

HorizontalSliderStyles

Gets the dictionary of named horizontal slider styles, keyed by style identifier.

public Dictionary<string, SliderStyle> HorizontalSliderStyles { get; }

Property Value

Dictionary<string, SliderStyle>

HorizontalSplitPaneStyle

Gets or sets the default style for horizontal split pane widgets.

public SplitPaneStyle HorizontalSplitPaneStyle { get; set; }

Property Value

SplitPaneStyle

HorizontalSplitPaneStyles

Gets the dictionary of named horizontal split pane styles, keyed by style identifier.

public Dictionary<string, SplitPaneStyle> HorizontalSplitPaneStyles { get; }

Property Value

Dictionary<string, SplitPaneStyle>

HorizontalStackPanelStyle

Gets or sets the default style for horizontal stack panels.

public WidgetStyle HorizontalStackPanelStyle { get; set; }

Property Value

WidgetStyle

HorizontalStackPanelStyles

Gets the dictionary of named horizontal stack panel styles, keyed by style identifier.

public Dictionary<string, WidgetStyle> HorizontalStackPanelStyles { get; }

Property Value

Dictionary<string, WidgetStyle>

LabelStyle

Gets or sets the default style for label widgets.

public LabelStyle LabelStyle { get; set; }

Property Value

LabelStyle

LabelStyles

Gets the dictionary of named label styles, keyed by style identifier.

public Dictionary<string, LabelStyle> LabelStyles { get; }

Property Value

Dictionary<string, LabelStyle>

ListBoxStyle

Gets or sets the default style for list box widgets.

public ListBoxStyle ListBoxStyle { get; set; }

Property Value

ListBoxStyle

ListBoxStyles

Gets the dictionary of named list box styles, keyed by style identifier.

public Dictionary<string, ListBoxStyle> ListBoxStyles { get; }

Property Value

Dictionary<string, ListBoxStyle>

PanelStyle

Gets or sets the default style for panel widgets.

public WidgetStyle PanelStyle { get; set; }

Property Value

WidgetStyle

PanelStyles

Gets the dictionary of named panel styles, keyed by style identifier.

public Dictionary<string, WidgetStyle> PanelStyles { get; }

Property Value

Dictionary<string, WidgetStyle>

RadioButtonStyle

Gets or sets the default style for radio button widgets.

public CheckButtonStyle RadioButtonStyle { get; set; }

Property Value

CheckButtonStyle

RadioButtonStyles

Gets the dictionary of named radio button styles, keyed by style identifier.

public Dictionary<string, CheckButtonStyle> RadioButtonStyles { get; }

Property Value

Dictionary<string, CheckButtonStyle>

ScrollViewerStyle

Gets or sets the default style for scroll viewer widgets.

public ScrollViewerStyle ScrollViewerStyle { get; set; }

Property Value

ScrollViewerStyle

ScrollViewerStyles

Gets the dictionary of named scroll viewer styles, keyed by style identifier.

public Dictionary<string, ScrollViewerStyle> ScrollViewerStyles { get; }

Property Value

Dictionary<string, ScrollViewerStyle>

SpinButtonStyle

Gets or sets the default style for spin button widgets.

public SpinButtonStyle SpinButtonStyle { get; set; }

Property Value

SpinButtonStyle

SpinButtonStyles

Gets the dictionary of named spin button styles, keyed by style identifier.

public Dictionary<string, SpinButtonStyle> SpinButtonStyles { get; }

Property Value

Dictionary<string, SpinButtonStyle>

TabControlStyle

Gets or sets the default style for tab control widgets.

public TabControlStyle TabControlStyle { get; set; }

Property Value

TabControlStyle

TabControlStyles

Gets the dictionary of named tab control styles, keyed by style identifier.

public Dictionary<string, TabControlStyle> TabControlStyles { get; }

Property Value

Dictionary<string, TabControlStyle>

TextBoxStyle

Gets or sets the default style for text box widgets.

public TextBoxStyle TextBoxStyle { get; set; }

Property Value

TextBoxStyle

TextBoxStyles

Gets the dictionary of named text box styles, keyed by style identifier.

public Dictionary<string, TextBoxStyle> TextBoxStyles { get; }

Property Value

Dictionary<string, TextBoxStyle>

TooltipStyle

Gets or sets the default style for tooltip labels.

public LabelStyle TooltipStyle { get; set; }

Property Value

LabelStyle

TooltipStyles

Gets the dictionary of named tooltip label styles, keyed by style identifier.

public Dictionary<string, LabelStyle> TooltipStyles { get; }

Property Value

Dictionary<string, LabelStyle>

TreeStyle

Gets or sets the default style for tree widgets.

public TreeStyle TreeStyle { get; set; }

Property Value

TreeStyle

TreeStyles

Gets the dictionary of named tree styles, keyed by style identifier.

public Dictionary<string, TreeStyle> TreeStyles { get; }

Property Value

Dictionary<string, TreeStyle>

VerticalMenuStyle

Gets or sets the default style for vertical menu widgets.

public MenuStyle VerticalMenuStyle { get; set; }

Property Value

MenuStyle

VerticalMenuStyles

Gets the dictionary of named vertical menu styles, keyed by style identifier.

public Dictionary<string, MenuStyle> VerticalMenuStyles { get; }

Property Value

Dictionary<string, MenuStyle>

VerticalProgressBarStyle

Gets or sets the default style for vertical progress bar widgets.

public ProgressBarStyle VerticalProgressBarStyle { get; set; }

Property Value

ProgressBarStyle

VerticalProgressBarStyles

Gets the dictionary of named vertical progress bar styles, keyed by style identifier.

public Dictionary<string, ProgressBarStyle> VerticalProgressBarStyles { get; }

Property Value

Dictionary<string, ProgressBarStyle>

VerticalSeparatorStyle

Gets or sets the default style for vertical separator widgets.

public SeparatorStyle VerticalSeparatorStyle { get; set; }

Property Value

SeparatorStyle

VerticalSeparatorStyles

Gets the dictionary of named vertical separator styles, keyed by style identifier.

public Dictionary<string, SeparatorStyle> VerticalSeparatorStyles { get; }

Property Value

Dictionary<string, SeparatorStyle>

VerticalSliderStyle

Gets or sets the default style for vertical slider widgets.

public SliderStyle VerticalSliderStyle { get; set; }

Property Value

SliderStyle

VerticalSliderStyles

Gets the dictionary of named vertical slider styles, keyed by style identifier.

public Dictionary<string, SliderStyle> VerticalSliderStyles { get; }

Property Value

Dictionary<string, SliderStyle>

VerticalSplitPaneStyle

Gets or sets the default style for vertical split pane widgets.

public SplitPaneStyle VerticalSplitPaneStyle { get; set; }

Property Value

SplitPaneStyle

VerticalSplitPaneStyles

Gets the dictionary of named vertical split pane styles, keyed by style identifier.

public Dictionary<string, SplitPaneStyle> VerticalSplitPaneStyles { get; }

Property Value

Dictionary<string, SplitPaneStyle>

VerticalStackPanelStyle

Gets or sets the default style for vertical stack panels.

public WidgetStyle VerticalStackPanelStyle { get; set; }

Property Value

WidgetStyle

VerticalStackPanelStyles

Gets the dictionary of named vertical stack panel styles, keyed by style identifier.

public Dictionary<string, WidgetStyle> VerticalStackPanelStyles { get; }

Property Value

Dictionary<string, WidgetStyle>

WhiteRegion

Gets a white texture region from the atlas, used for solid color rendering.

[Browsable(false)]
public TextureRegion WhiteRegion { get; }

Property Value

TextureRegion

WindowStyle

Gets or sets the default style for window widgets.

public WindowStyle WindowStyle { get; set; }

Property Value

WindowStyle

WindowStyles

Gets the dictionary of named window styles, keyed by style identifier.

public Dictionary<string, WindowStyle> WindowStyles { get; }

Property Value

Dictionary<string, WindowStyle>

Methods

Clone()

Creates a deep copy of this stylesheet including all styles and fonts.

public Stylesheet Clone()

Returns

Stylesheet

A new Stylesheet instance with cloned styles and fonts.

ToXml()

Converts the stylesheet to an XML string representation.

public string ToXml()

Returns

string

An XML string containing all styles defined in this stylesheet.