mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-06 03:07:04 +02:00
Fix suffixes converter, part 1
1. fix #568, fix #566 fix #553, fix #559 2. simple refactoring
This commit is contained in:
@@ -5,20 +5,26 @@ using System.Windows.Markup;
|
||||
|
||||
namespace Wox.Plugin.Program
|
||||
{
|
||||
public class StringEmptyConverter : MarkupExtension, IValueConverter
|
||||
public class LocationConverter : MarkupExtension, IValueConverter
|
||||
{
|
||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
return string.IsNullOrEmpty((string)value) ? parameter : value;
|
||||
var text = value as string;
|
||||
if (string.IsNullOrEmpty(text))
|
||||
{
|
||||
return string.Empty;
|
||||
}
|
||||
else
|
||||
{
|
||||
return text;
|
||||
}
|
||||
}
|
||||
|
||||
public object ConvertBack(
|
||||
object value, Type targetType, object parameter, CultureInfo culture)
|
||||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
throw new NotSupportedException();
|
||||
}
|
||||
|
||||
|
||||
public override object ProvideValue(IServiceProvider serviceProvider)
|
||||
{
|
||||
return this;
|
||||
|
||||
Reference in New Issue
Block a user