Class ValueSource<T>
An workflow value source.
[TypeConverter(typeof(ValueSourceTypeConverter))]
public abstract class ValueSource<T> : ValueSource
Type Parameters
T
The value type.
- Inheritance
-
ValueSource<T>
- Derived
- Inherited Members
Remarks
ValueSource<T> of type object should generally not be used for workflow type properties, preferring ValueSource instead so that assignments in XAML and implicit conversions in code work as expected.
Methods
EvaluateAsObjectAsync(ActivityContext, CancellationToken)
Evaluates the value.
public override sealed Task<object> EvaluateAsObjectAsync(ActivityContext context, CancellationToken cancellationToken = default)
Parameters
context
ActivityContextThe activity context.
cancellationToken
CancellationTokenA token that can request cancelling the evaluation.
Returns
- Task<object>
A task that represents the asynchronous operation. The value of its Result property contains the resulting value.
EvaluateAsync(ActivityContext, CancellationToken)
Evaluates the value.
public abstract Task<T> EvaluateAsync(ActivityContext context, CancellationToken cancellationToken = default)
Parameters
context
ActivityContextThe activity context.
cancellationToken
CancellationTokenA token that can request cancelling the evaluation.
Returns
- Task<T>
A task that represents the asynchronous operation. The value of its Result property contains the resulting value.
Operators
implicit operator ValueSource<T>(T)
Defines an implicit conversion of a constant value to a ValueSource<T> of the value type.
public static implicit operator ValueSource<T>(T value)
Parameters
value
TThe constant value.
Returns
- ValueSource<T>