Table of Contents

Class AvaloniaAssets

Namespace
Tripous.Desktop
Assembly
Tripous.Desktop.dll

Handles Avalonia resources.

public static class AvaloniaAssets
Inheritance
AvaloniaAssets
Inherited Members

Methods

Combine(string, params string[])

Combines parts into an Avalonia asset URI

public static string Combine(string BasePath, params string[] Parts)

Parameters

BasePath string
Parts string[]

Returns

string

CreateImage(ImageSizeType, Size?)

Creates an image of a specified size.

public static Image CreateImage(ImageSizeType SizeType, Size? Size = null)

Parameters

SizeType ImageSizeType
Size Size?

Returns

Image

FindAsset(string)

Finds and returns an asset as a stream, if any, else null.

WARNING: The returned stream should be disposed by the caller.

public static Stream FindAsset(string FileName)

Parameters

FileName string

Returns

Stream

FindImage(string)

Returns an image of any size, if found in assets, else null.

NOTE: It searches the application assemblies too.

public static Image FindImage(string FileName)

Parameters

FileName string

Returns

Image

FindImage(string, Size)

Returns an image of a specified size, if found in assets, else null.

NOTE: It searches the application assemblies too.

public static Image FindImage(string FileName, Size Size)

Parameters

FileName string
Size Size

Returns

Image

FindImage(string, ImageSizeType, Size?)

Returns an image of a specified size, if found in assets, else null.

NOTE: It searches the application assemblies too.

public static Image FindImage(string FileName, ImageSizeType SizeType, Size? Size = null)

Parameters

FileName string
SizeType ImageSizeType
Size Size?

Returns

Image

FindImage16(string)

Returns an image of a specified size, if found in assets, else null.

NOTE: It searches the application assemblies too.

public static Image FindImage16(string FileName)

Parameters

FileName string

Returns

Image

FindImage32(string)

Returns an image of a specified size, if found in assets, else null.

NOTE: It searches the application assemblies too.

public static Image FindImage32(string FileName)

Parameters

FileName string

Returns

Image

FindUri(string)

Finds and returns the Uri of an asset, if any, else null.

Combines a number of folders and the specified filename.

NOTE: It searches the application assemblies too.

public static Uri FindUri(string FileName)

Parameters

FileName string

Returns

Uri

FindUri(string, string)

Finds and returns the Uri of an asset, if any, else null.

Combines a specified folder and filename.

NOTE: It searches the application assemblies too.

public static Uri FindUri(string Folder, string FileName)

Parameters

Folder string
FileName string

Returns

Uri

FindUri(string[], string)

Finds and returns the Uri of an asset, if any, else null.

Combines the specified folders and filename.

NOTE: It searches the application assemblies too.

public static Uri FindUri(string[] Folders, string FileName)

Parameters

Folders string[]
FileName string

Returns

Uri

FindUriByPath(string)

Returns true if an asset resource path exists, e.g. avares://Tripous.Desktop/Images/MyImage.png

public static Uri FindUriByPath(string AssetPath)

Parameters

AssetPath string

Returns

Uri

SetImage(Image, string)

Sets the Avalonia.Controls.Image.Source of a specified image.

public static bool SetImage(Image Image, string FileName)

Parameters

Image Image
FileName string

Returns

bool

SetImage(Image, Uri)

Sets the Avalonia.Controls.Image.Source of a specified image.

public static bool SetImage(Image Image, Uri Uri)

Parameters

Image Image
Uri Uri

Returns

bool