mirror of
https://github.com/BililiveRecorder/BililiveRecorder.git
synced 2024-12-27 12:35:35 +08:00
30 lines
830 B
C#
30 lines
830 B
C#
using System;
|
|
using System.Globalization;
|
|
using System.Windows.Data;
|
|
|
|
namespace BililiveRecorder.WPF.Converters
|
|
{
|
|
public class MultiBoolToValueConverter : IMultiValueConverter
|
|
{
|
|
public object FalseValue { get; set; }
|
|
public object TrueValue { get; set; }
|
|
|
|
public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
|
|
{
|
|
foreach (var value in values)
|
|
{
|
|
if ((value is bool boolean) && boolean == false)
|
|
{
|
|
return FalseValue;
|
|
}
|
|
}
|
|
return TrueValue;
|
|
}
|
|
|
|
public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
}
|
|
}
|