DirectionConverter.cs 961 Bytes
Newer Older
潘栩锋's avatar
潘栩锋 committed
1 2 3 4 5 6
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Data;

潘栩锋's avatar
潘栩锋 committed
7
namespace FLY.Thick.Base.UI.Converter
潘栩锋's avatar
潘栩锋 committed
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
{

    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
    }


}