using System;
using System.Collections.ObjectModel;
using System.Globalization;
using System.Windows.Data;
using BS.Shared.DataContracts;

namespace BeWo.Converter
{
    public class CollectionContainsTag2BoolConverter : IMultiValueConverter
    {
        public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
        {
            var dcObject = values[0] as IFilterableDC;
            var selectedForPrinting = values[1] as ObservableCollection<IFilterableDC>;

            if (dcObject == null || selectedForPrinting == null)
                return false;

            return selectedForPrinting.Contains(dcObject);
        }

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