using Client.ISServiceRef;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Data;
using System.Windows.Media;
using System.Windows.Media.Imaging;

namespace Client.Converters
{
    public class RequestStateConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            try
            {
                RequestState requestState = (RequestState)value;

                switch(requestState)
                {
                    case RequestState.Approved:
                        return Properties.Resources.RequestStateApproved;
                    case RequestState.Declined:
                        return Properties.Resources.RequestStateDeclined;
                    default:
                        return Properties.Resources.RequestStateWaiting;
                }
            }
            catch
            {
                return string.Empty;
            }
        }

        // No need to implement converting back on a one-way binding 
        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
