TaskResultConverter Class

Definition

A converter that can be used to safely retrieve results from Task<TResult> instances. This is needed because accessing Result when the task has not completed yet will block the current thread and might cause a deadlock (eg. if the task was scheduled on the same synchronization context where the result is being retrieved from). The methods in this converter will safely return default if the input task is still running, or if it has faulted or has been canceled.

public sealed class TaskResultConverter : Microsoft.UI.Xaml.Data.IValueConverter
type TaskResultConverter = class
    interface IValueConverter
Public NotInheritable Class TaskResultConverter
Implements IValueConverter
Inheritance
TaskResultConverter
Implements
Microsoft.UI.Xaml.Data.IValueConverter

Constructors

TaskResultConverter()

Methods

Convert(Object, Type, Object, String)
ConvertBack(Object, Type, Object, String)

Applies to