2014-03-29 06:42:43 +00:00
|
|
|
|
using System;
|
2016-01-06 21:34:42 +00:00
|
|
|
|
using System.Globalization;
|
2014-03-29 06:42:43 +00:00
|
|
|
|
using System.Windows.Data;
|
|
|
|
|
|
using System.Windows.Markup;
|
|
|
|
|
|
|
2020-04-21 09:12:17 +00:00
|
|
|
|
namespace Flow.Launcher.Plugin.Program
|
2014-03-29 06:42:43 +00:00
|
|
|
|
{
|
2016-04-24 01:51:20 +00:00
|
|
|
|
public class LocationConverter : MarkupExtension, IValueConverter
|
2014-03-29 06:42:43 +00:00
|
|
|
|
{
|
2016-01-06 21:34:42 +00:00
|
|
|
|
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
2014-03-29 06:42:43 +00:00
|
|
|
|
{
|
2016-04-24 01:51:20 +00:00
|
|
|
|
var text = value as string;
|
|
|
|
|
|
if (string.IsNullOrEmpty(text))
|
|
|
|
|
|
{
|
|
|
|
|
|
return string.Empty;
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
return text;
|
|
|
|
|
|
}
|
2014-03-29 06:42:43 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
2016-04-24 01:51:20 +00:00
|
|
|
|
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
2014-03-29 06:42:43 +00:00
|
|
|
|
{
|
|
|
|
|
|
throw new NotSupportedException();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override object ProvideValue(IServiceProvider serviceProvider)
|
|
|
|
|
|
{
|
|
|
|
|
|
return this;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|