25 lines
736 B
C#
25 lines
736 B
C#
using System;
|
|
using System.Windows;
|
|
using System.Windows.Data;
|
|
|
|
namespace JD.WPF.Converters
|
|
{
|
|
public class VisibilityIfStringNotEmptyConverter : IValueConverter
|
|
{
|
|
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
|
|
{
|
|
if (value == null)
|
|
return Visibility.Collapsed;
|
|
|
|
if (string.IsNullOrEmpty(value.ToString()))
|
|
return Visibility.Collapsed;
|
|
|
|
return Visibility.Visible;
|
|
}
|
|
|
|
public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
}
|
|
}
|