CommunityToolkit.WinUI.UI.Converters Namespace

Classes

BoolNegationConverter

Value converter that applies NOT operator to a Boolean value.

BoolToObjectConverter

This class converts a boolean value into an other object. Can be used to convert true/false to visibility, a couple of colors, couple of images, etc.

BoolToVisibilityConverter

This class converts a boolean value into a Visibility enumeration.

CollectionVisibilityConverter

This class converts a collection size to visibility.

ColorToDisplayNameConverter

Gets the approximated display name for the color.

DoubleToObjectConverter

This class converts a double value into an other object. Can be used to convert doubles to visibility, a couple of colors, couple of images, etc. If GreaterThan and LessThan are both set, the logic looks for a value between the two values. Otherwise the logic looks for the value to be GreaterThan or LessThan the specified value. The ConverterParameter can be used to invert the logic.

DoubleToVisibilityConverter

This class converts a double value into a Visibility enumeration.

EmptyCollectionToObjectConverter

This class converts a collection size into an other object. Can be used to convert to bind a visibility, a color or an image to the size of the collection.

EmptyObjectToObjectConverter

This class converts an object value into a an object (if the value is null returns the false value). Can be used to bind a visibility, a color or an image to the value of an object.

EmptyStringToObjectConverter

This class converts a string value into a an object (if the value is null or empty returns the false value). Can be used to bind a visibility, a color or an image to the value of a string.

FileSizeToFriendlyStringConverter

Converts a file size in bytes to a more human-readable friendly format using ToFileSizeString(Int64)

FormatStringConverter

Value converter that converts an IFormattable to a formatted String. The string format needs to be passed as the converter parameter.

RemoteSystemKindToSymbolConverter

Converter to convert Device Type to Icon

ResourceNameToResourceStringConverter

Value converter that look up for the source string in the App Resources strings and returns its value, if found.

StringFormatConverter

This class provides a binding converter to display formatted strings

StringVisibilityConverter

This class converts a string value into a Visibility value (if the value is null or empty returns a collapsed value).

TaskResultConverter

A converter that can be used to safely retrieve results from Task<TResult> instances. This is needed because accessing Result when the task has not completed yet will block the current thread and might cause a deadlock (eg. if the task was scheduled on the same synchronization context where the result is being retrieved from). The methods in this converter will safely return default if the input task is still running, or if it has faulted or has been canceled.

TypeToObjectConverter

This class returns an object or another, depending on whether the type of the provided value matches another provided Type.

VisibilityToBoolConverter

This class converts a Visibility enumeration to a boolean value.