Click or drag to resize

ExtensionsRunAsync Method

Handles neccessary setting of the IsLoading flag and the error handling

Namespace:  Cauldron.XAML
Assembly:  Cauldron.Win32.WPF (in Cauldron.Win32.WPF.dll) Version: 3.2.0.1 (3.2.0.1)
Syntax
C#
public static Task<bool> RunAsync(
	this IViewModel viewModel,
	Func<Task> action
)

Parameters

viewModel
Type: Cauldron.XAML.ViewModelsIViewModel
The viewmodel to start the operation from
action
Type: SystemFuncTask
The action that occures

Return Value

Type: TaskBoolean
true if this Action was executed without Exception; otherwise, false.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type IViewModel. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
Exceptions
ExceptionCondition
ArgumentNullExceptionviewModel is null
ArgumentNullExceptionaction is null
See Also