New to Telerik UI for WPF? Start a free 30-day trial

Defines the allowlist of global and receiver functions that can be called from an expression.

Only functions registered in this registry can be called. Use CreateWithBuiltInFunctions() to include WPF built-ins, or CreateEmpty() to start without any functions. Methods declared by object, generic methods, and methods with by-reference or pointer parameters are not supported. Register custom functions before parsing.

Definition

Namespace:Telerik.Expressions

Assembly:Telerik.Windows.Data.dll

Syntax:

C#
public sealed class ExpressionFunctionRegistry

Inheritance: objectExpressionFunctionRegistry

Methods

Registers a public instance method on an ExpressionFunctionContext type as a global expression function.

C#
public void AddGlobalFunction(Type contextType, string name, Type[] parameterTypes)
Parameters:contextTypeType

The context type on which the method is defined.

namestring

The name used to call the function in an expression.

parameterTypesType[]

The exact parameter types of the method.

Registers a public instance method on a receiver type as an expression function.

C#
public void AddInstanceFunction(Type receiverType, string name, Type[] parameterTypes)
Parameters:receiverTypeType

The type of the expression receiver.

namestring

The method name used in the expression.

parameterTypesType[]

The exact parameter types of the method.

Registers or replaces a global expression function for the specified context type and signature.

C#
public void AssignGlobalFunction(Type contextType, string name, Type[] parameterTypes)
Parameters:contextTypeType

The context type on which the method is defined.

namestring

The name used to call the function in an expression.

parameterTypesType[]

The exact parameter types of the method.

Registers or replaces a receiver expression function for the specified type and signature.

C#
public void AssignInstanceFunction(Type receiverType, string name, Type[] parameterTypes)
Parameters:receiverTypeType

The type of the expression receiver.

namestring

The method name used in the expression.

parameterTypesType[]

The exact parameter types of the method.

Creates an empty registry with no registered custom functions.

C#
public static ExpressionFunctionRegistry CreateEmpty()
Returns:

ExpressionFunctionRegistry

A new empty function registry.

Creates a registry seeded with WPF's built-in expression functions.

C#
public static ExpressionFunctionRegistry CreateWithBuiltInFunctions()
Returns:

ExpressionFunctionRegistry

A new registry containing the WPF built-in expression functions.