mirror of
https://github.com/microsoft/PowerToys.git
synced 2024-12-14 03:37:10 +08:00
18 lines
491 B
C#
18 lines
491 B
C#
using System;
|
|
using System.Globalization;
|
|
|
|
namespace Wox.Converters
|
|
{
|
|
public class StringEmptyConverter : ConvertorBase<StringEmptyConverter>
|
|
{
|
|
public override object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
|
{
|
|
return string.IsNullOrEmpty((string)value) ? parameter : value;
|
|
}
|
|
|
|
public override object ProvideValue(IServiceProvider serviceProvider)
|
|
{
|
|
return this;
|
|
}
|
|
}
|
|
} |