2014-03-29 14:42:43 +08:00
|
|
|
|
using System;
|
2016-01-07 05:34:42 +08:00
|
|
|
|
using System.Globalization;
|
2014-03-29 14:42:43 +08:00
|
|
|
|
using System.Windows.Data;
|
|
|
|
|
using System.Windows.Markup;
|
|
|
|
|
|
2015-01-03 15:20:34 +08:00
|
|
|
|
namespace Wox.Plugin.Program
|
2014-03-29 14:42:43 +08:00
|
|
|
|
{
|
|
|
|
|
public class StringEmptyConverter : MarkupExtension, IValueConverter
|
|
|
|
|
{
|
2016-01-07 05:34:42 +08:00
|
|
|
|
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
2014-03-29 14:42:43 +08:00
|
|
|
|
{
|
|
|
|
|
return string.IsNullOrEmpty((string)value) ? parameter : value;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public object ConvertBack(
|
2016-01-07 05:34:42 +08:00
|
|
|
|
object value, Type targetType, object parameter, CultureInfo culture)
|
2014-03-29 14:42:43 +08:00
|
|
|
|
{
|
|
|
|
|
throw new NotSupportedException();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public override object ProvideValue(IServiceProvider serviceProvider)
|
|
|
|
|
{
|
|
|
|
|
return this;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|