Table of Contents

Class Icon

Namespace
Dmnk.Icons.Core
Assembly
Dmnk.Icons.Core.dll

Defines an icon to be rendered, including its definition, size, color, and accessible name.

public sealed class Icon
Inheritance
Icon
Inherited Members

Constructors

Icon(IconDefinition, Size, Color?, string?)

Defines an icon to be rendered, including its definition, size, color, and accessible name.

public Icon(IconDefinition definition, Size size, Color? color = null, string? accessibleName = null)

Parameters

definition IconDefinition
size Size
color Color?
accessibleName string

Properties

AccessibleName

The accessible name of the icon, used for screen readers and other assistive technologies. If null, the technical name of the icon will be used as a fallback.

public string? AccessibleName { get; }

Property Value

string

Color

The color of the icon. If null, the default color of the icon will be used. This will of course also only work for some icons, e.g. svg icons that define a single path.

public Color? Color { get; }

Property Value

Color?

Definition

public IconDefinition Definition { get; }

Property Value

IconDefinition

Size

The size of the icon in px. User level zoom is obviously not considered.

public Size Size { get; }

Property Value

Size

Methods

WithAccessibleName(string)

Creates a new icon with the same everything, but a different accessible name.

public Icon WithAccessibleName(string accessibleName)

Parameters

accessibleName string

Returns

Icon

WithColor(Color)

Creates a new icon with the same everything, but a different color.

public Icon WithColor(Color color)

Parameters

color Color

Returns

Icon