24 lines
731 B
C#
24 lines
731 B
C#
using System;
|
|
using System.Globalization;
|
|
using System.Linq;
|
|
using System.Windows;
|
|
using System.Windows.Data;
|
|
|
|
namespace BeWo.Converter
|
|
{
|
|
public class StringLengthVisibilityMultiConverter : IMultiValueConverter
|
|
{
|
|
public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
|
|
{
|
|
if(values == null || values.Length < 2 || values.Any(a => string.IsNullOrWhiteSpace(a?.ToString())))
|
|
{
|
|
return Visibility.Collapsed;
|
|
}
|
|
|
|
return Visibility.Visible;
|
|
}
|
|
|
|
public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture) => throw new NotImplementedException();
|
|
}
|
|
}
|