| TryCastWorkerTValueWhenTTarget Method |
Tries to cast the value to TTarget; if the cast succeeds, the action is executed.
Namespace: TomsToolbox.DesktopAssembly: TomsToolbox.Desktop (in TomsToolbox.Desktop.dll) Version: 2.21.0+44d18b541fc9419ec3c549350a832394661b2a4d
XMLNS for XAML: Not mapped to an xmlns.
Syntax public TryCastWorker<TValue> When<TTarget>(
Action<TTarget> action
)
where TTarget : class, TValue
Public Function When(Of TTarget As {Class, TValue}) (
action As Action(Of TTarget)
) As TryCastWorker(Of TValue)
Parameters
- action ActionTTarget
- The action.
Type Parameters
- TTarget
- The type of the target.
Return Value
TryCastWorkerTValueThe object itself to continue with fluent notation.
Remarks
If any previous method in the fluent chain has already succeeded, this method does nothing.
See Also