18 lines
479 B
C#
18 lines
479 B
C#
using System.Globalization;
|
|
using System.Windows.Data;
|
|
|
|
namespace Sai.Toolkit.Mvvm.Converters;
|
|
|
|
public class TaskResultConverter : IValueConverter
|
|
{
|
|
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
|
{
|
|
return value is Task<string> val && val.IsCompleted ? val.Result : (object)null;
|
|
}
|
|
|
|
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
}
|