using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Data;

namespace parkMonitor.view.util {
	/// <summary></summary>
	public class OrBind : MultiBinding {
		public OrBind() {
			Converter = OrCvt.ins;
		}
	}

	public class OrCvt : IMultiValueConverter {
		public static OrCvt ins = new OrCvt();

		public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture) {
			for(int i = 0; i < values.Length; ++i) {
				bool? b = values[i] as bool?;
				if(b == true) {
					return true;
				}
			}
			return false;
		}

		public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture) {
			throw new NotImplementedException();
		}
	}
	
}
