Class SetValueCommand
Factory methods for SetValueCommand<T>.
public static class SetValueCommand
- Inheritance
-
objectSetValueCommand
Methods
ForNullable<T>(Func<T?>, Action<T?>, T?)
Creates a new command for setting a nullable value.
public static SetValueCommand<T?> ForNullable<T>(Func<T?> getValue, Action<T?> setValue, T? newValue)
Parameters
getValue
Func<T>A delegate that returns the current value.
setValue
Action<T>A delegate that sets the value.
newValue
TThe new value to be set.
Returns
Type Parameters
T
The type of the value to set.
ForNullable<T>(Expression<Func<T?>>, T?)
Creates a new command for setting a nullable value.
public static SetValueCommand<T?> ForNullable<T>(Expression<Func<T?>> expression, T? newValue)
Parameters
expression
Expression<Func<T>>An expression pointing to the property.
newValue
TThe new value to be set.
Returns
Type Parameters
T
The type of value the property contains.
For<T>(PropertyPointer<T>, T)
Creates a new command for setting a value.
public static SetValueCommand<T> For<T>(PropertyPointer<T> pointer, T newValue)
Parameters
pointer
PropertyPointer<T>The object controlling how to read/write the value to be modified.
newValue
TThe new value to be set.
Returns
Type Parameters
T
The type of the value to set.
For<T>(Func<T>, Action<T>, T)
Creates a new command for setting a value.
public static SetValueCommand<T> For<T>(Func<T> getValue, Action<T> setValue, T newValue) where T : notnull
Parameters
getValue
Func<T>A delegate that returns the current value.
setValue
Action<T>A delegate that sets the value.
newValue
TThe new value to be set.
Returns
Type Parameters
T
The type of the value to set.
For<T>(Expression<Func<T>>, T)
Creates a new command for setting a value.
public static SetValueCommand<T> For<T>(Expression<Func<T>> expression, T newValue) where T : notnull
Parameters
expression
Expression<Func<T>>An expression pointing to the property.
newValue
TThe new value to be set.
Returns
Type Parameters
T
The type of value the property contains.