Iconify Class

Provides access to Iconify icons.

public static class Iconify

Remarks

The icon sets declared with IconifyIconSet items in the project file are generated at build time and exposed as static extension properties of this class, such as Iconify.Mdi.Icons.Home.

The Load methods read any icon set in the IconifyJSON format at run time, such as the files of the iconify/icon-sets repository.

Methods

NameDescription
Load(Stream)Loads an icon set in the IconifyJSON format from a stream.
Load(string)Loads an icon set in the IconifyJSON format from a file.
LoadAsync(Stream, CancellationToken)Loads an icon set in the IconifyJSON format from a stream.
LoadAsync(string, CancellationToken)Loads an icon set in the IconifyJSON format from a file.
Parse(string)Parses an icon set in the IconifyJSON format.

Load overloads

Load(Stream)

Iconify.cs

Loads an icon set in the IconifyJSON format from a stream.

public static IconifyIconSet Load(Stream stream)
Parameters
stream Stream
The stream that contains the JSON document, encoded in UTF-8. It is read to the end, but not closed.
Returns

IconifyIconSet The icon set, with its aliases resolved.

Exceptions
FormatException
The stream does not contain a valid icon set.

Load(string)

Iconify.cs

Loads an icon set in the IconifyJSON format from a file.

public static IconifyIconSet Load(string path)
Parameters
path string
The path of the JSON file.
Returns

IconifyIconSet The icon set, with its aliases resolved.

Exceptions
FormatException
The file is not a valid icon set.

LoadAsync overloads

LoadAsync(Stream, CancellationToken)

Iconify.cs

Loads an icon set in the IconifyJSON format from a stream.

net10.0

public static Task<IconifyIconSet> LoadAsync(Stream stream, CancellationToken cancellationToken = default)

net11.0

public static Task<IconifyIconSet> LoadAsync(Stream stream, CancellationToken cancellationToken = default)
Parameters
stream Stream
The stream that contains the JSON document, encoded in UTF-8. It is read to the end, but not closed.
cancellationToken CancellationToken
The token to monitor for cancellation requests.
Returns

Task<IconifyIconSet> The icon set, with its aliases resolved.

Exceptions
FormatException
The stream does not contain a valid icon set.

LoadAsync(string, CancellationToken)

Iconify.cs

Loads an icon set in the IconifyJSON format from a file.

net10.0

public static Task<IconifyIconSet> LoadAsync(string path, CancellationToken cancellationToken = default)

net11.0

public static Task<IconifyIconSet> LoadAsync(string path, CancellationToken cancellationToken = default)
Parameters
path string
The path of the JSON file.
cancellationToken CancellationToken
The token to monitor for cancellation requests.
Returns

Task<IconifyIconSet> The icon set, with its aliases resolved.

Exceptions
FormatException
The file is not a valid icon set.

Parse(string)

Iconify.cs

Parses an icon set in the IconifyJSON format.

public static IconifyIconSet Parse(string json)

Parameters

json string
The JSON document.

Returns

IconifyIconSet The icon set, with its aliases resolved.

Exceptions

FormatException
The text is not a valid icon set.