New to Telerik UI for .NET MAUIStart a free 30-day trial

Provides type mapping functionality for managing adapters and instance mappings between source and target objects.

Definition

Namespace:Telerik.Maui.Controls.Compatibility.Common

Assembly:Telerik.Maui.Controls.Compatibility.dll

Syntax:

C#
public class TypeMappings

Inheritance: objectTypeMappings

Constructors

Initializes a new instance of the TypeMappings class.

C#
protected TypeMappings()

Methods

Creates an instance of the target type based on the source item and updates the mapping.

C#
public static object CreateInstance(object sourceItem, object parameter = null)
Parameters:sourceItemobject

The source item to create an instance for.

parameterobject

Optional parameter for instance creation.

Returns:

object

The created instance.

Disposes the target instance associated with the specified source instance.

C#
public static void DisposeTargetInstance(object sourceInstance)
Parameters:sourceInstanceobject

The source instance whose target should be disposed.

Gets the adapter associated with the specified source instance.

C#
public static object GetAdapter(object sourceInstance)
Parameters:sourceInstanceobject

The source instance to get the adapter for.

Returns:

object

The adapter instance.

Gets the event arguments converted to the specified target type.

C#
public static object GetEventArgs(Type targetType, object args)
Parameters:targetTypeType

The target type for the event arguments.

argsobject

The source event arguments.

Returns:

object

The converted event arguments.

Gets the target instance associated with the specified source instance.

C#
public static object GetTargetInstance(object sourceInstance)
Parameters:sourceInstanceobject

The source instance to get the target for.

Returns:

object

The target instance.

Updates the instance mapping between the source and target items.

C#
public static void UpdateInstance(object sourceItem, object targetItem)
Parameters:sourceItemobject

The source item.

targetItemobject

The target item.