init
This commit is contained in:
19
Common/DTS.Common/Converters/BooleanOrMultiConverter.cs
Normal file
19
Common/DTS.Common/Converters/BooleanOrMultiConverter.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Windows.Data;
|
||||
|
||||
namespace DTS.Common.Converters
|
||||
{
|
||||
public class BooleanOrMultiConverter : IMultiValueConverter
|
||||
{
|
||||
public object Convert(object[] values, Type targetType, object parameter, System.Globalization.CultureInfo culture)
|
||||
{
|
||||
return !Array.TrueForAll(values, val => val is bool) ? false : (object)Array.Exists(values, val => (bool)val);
|
||||
}
|
||||
|
||||
public object[] ConvertBack(object value, Type[] targetTypes, object parameter, System.Globalization.CultureInfo culture)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user