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
|
|
|
|
{
|
2016-04-24 09:51:20 +08:00
|
|
|
|
public class LocationConverter : MarkupExtension, IValueConverter
|
2014-03-29 14:42:43 +08:00
|
|
|
|
{
|
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
|
|
|
|
{
|
2016-04-24 09:51:20 +08:00
|
|
|
|
var text = value as string;
|
|
|
|
|
if (string.IsNullOrEmpty(text))
|
|
|
|
|
{
|
|
|
|
|
return string.Empty;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
return text;
|
|
|
|
|
}
|
2014-03-29 14:42:43 +08:00
|
|
|
|
}
|
|
|
|
|
|
2016-04-24 09:51:20 +08:00
|
|
|
|
public object ConvertBack(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;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|