using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Data;

namespace FLY.Thick.Base.UI.Converter
{

    public class ForwConverter : IValueConverter
    {
        #region IValueConverter 成员

        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            Misc.DIRECTION direction = (Misc.DIRECTION)value;
            if (direction == Misc.DIRECTION.FORWARD)
            {
                return true;
            }
            else
            {
                return false;
            }
        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            bool b = (bool)value;
            if (b)
                return Misc.DIRECTION.FORWARD;
            return Misc.DIRECTION.BACKWARD;
        }

        #endregion
    }


}
