Class
TimeOnlyToTimeSpanConverter

Represents an IValueConverter that converts TimeOnly to TimeSpan and converts back TimeSpan to TimeOnly.

Definition

Namespace:Telerik.Maui.Controls

Assembly:Telerik.Maui.Controls.dll

Syntax:

cs-api-definition
public class TimeOnlyToTimeSpanConverter : IValueConverter

Inheritance: objectTimeOnlyToTimeSpanConverter

Implements: IValueConverter

Constructors

TimeOnlyToTimeSpanConverter()

Declaration

cs-api-definition
public TimeOnlyToTimeSpanConverter()

Methods

Convert(object, Type, object, CultureInfo)

Converts a TimeOnly value to a TimeSpan.

Declaration

cs-api-definition
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)

Parameters

value

object

The value to convert. Should be a TimeOnly instance.

targetType

Type

The type to convert to.

parameter

object

An optional parameter (not used).

culture

CultureInfo

The culture to use for conversion (not used).

Returns

object

A TimeSpan representation of the TimeOnly value, or the original value if conversion is not possible.

ConvertBack(object, Type, object, CultureInfo)

Converts a TimeSpan value back to a TimeOnly.

Declaration

cs-api-definition
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)

Parameters

value

object

The value to convert back. Should be a TimeSpan instance.

targetType

Type

The type to convert back to.

parameter

object

An optional parameter (not used).

culture

CultureInfo

The culture to use for conversion (not used).

Returns

object

A TimeOnly representation of the TimeSpan value, or the original value if conversion is not possible.