summaryrefslogtreecommitdiff
path: root/Decompiler/Gestor.Application.Converters/MultiBoolToVisibilityConverter.cs
blob: 0d97cc33aa144061aab1bd6cb424c589c6585785 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
using System;
using System.Globalization;
using System.Linq;
using System.Windows;
using System.Windows.Data;

namespace Gestor.Application.Converters;

public class MultiBoolToVisibilityConverter : IMultiValueConverter
{
	public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
	{
		try
		{
			return (object)(Visibility)((!values.All((object value) => (bool)value)) ? 2 : 0);
		}
		catch
		{
			return false;
		}
	}

	public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
	{
		return null;
	}
}