| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 | using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Windows.Data;namespace Aitex.UI.RecipeEditor{    public class CellBorderConverter : IValueConverter    {        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)        {            try            {                bool v = (bool)value;                if (v)                    return new System.Windows.Thickness(4, 0, 4, 0);                else                    return new System.Windows.Thickness(0, 0, 0, 0);            }            catch (Exception ex)            {                System.Diagnostics.Debug.WriteLine(ex.Message);            }            return new System.Windows.Thickness(0, 0, 0, 0);        }        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)        {            return null;        }    }    public class JumpCellBorderConverter : IValueConverter    {        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)        {            bool v;            bool.TryParse(value.ToString(), out v);            double t = v ? 2 : 0;            return new System.Windows.Thickness(t, t, t, t);        }        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)        {            return null;        }    }}
 |