Table of Contents

Class BindingHelper

Namespace
SharpConsoleUI.DataBinding
Assembly
SharpConsoleUI.dll

Utility methods for expression-based data binding.

public static class BindingHelper
Inheritance
BindingHelper
Inherited Members

Methods

AddDeferredBinding(object, Action<BaseControl>)

Stores a binding action to be applied when the builder produces its control.

public static void AddDeferredBinding(object builder, Action<BaseControl> apply)

Parameters

builder object
apply Action<BaseControl>

ApplyDeferredBindings(object, BaseControl)

Applies all deferred bindings to the built control, then removes them. Called from Build() methods on builders that implement IControlBuilder<TControl>.

public static void ApplyDeferredBindings(object builder, BaseControl control)

Parameters

builder object
control BaseControl

CreateSetter<TTarget, TValue>(Expression<Func<TTarget, TValue>>)

Compiles a setter action from a property-access expression.

public static Action<TTarget, TValue> CreateSetter<TTarget, TValue>(Expression<Func<TTarget, TValue>> expression)

Parameters

expression Expression<Func<TTarget, TValue>>

Returns

Action<TTarget, TValue>

Type Parameters

TTarget
TValue

GetPropertyName<T, TValue>(Expression<Func<T, TValue>>)

Extracts the property name from a member-access expression.

public static string GetPropertyName<T, TValue>(Expression<Func<T, TValue>> expression)

Parameters

expression Expression<Func<T, TValue>>

Returns

string

Type Parameters

T
TValue