26 lines
748 B
C#
26 lines
748 B
C#
using System;
|
|
using System.Globalization;
|
|
using System.Windows.Data;
|
|
|
|
namespace Torch.Server.Views.Converters
|
|
{
|
|
public class BooleanAndConverter : IMultiValueConverter
|
|
{
|
|
public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
|
|
{
|
|
foreach (var value in values)
|
|
{
|
|
if (value is bool b && b == false)
|
|
{
|
|
return false;
|
|
}
|
|
}
|
|
return true;
|
|
}
|
|
public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
|
|
{
|
|
throw new NotSupportedException("BooleanAndConverter is a OneWay converter.");
|
|
}
|
|
}
|
|
}
|