using System;
using System.Windows.Data;
using System.Windows.Input;

namespace Valg.EVA.Skanning.Assets.Converter
{
    [ValueConversion(typeof(bool), typeof(bool))]
    public class BusyToCursorConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter,
            System.Globalization.CultureInfo culture)
        {
            if (targetType != typeof(Cursor))
                throw new InvalidOperationException("The target must be a cursor");

            return ((bool)value) ? Cursors.Wait : Cursors.Arrow;
        }

        public object ConvertBack(object value, Type targetType, object parameter,
            System.Globalization.CultureInfo culture)
        {
            throw new NotSupportedException();
        }
    }
}
