public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            string optValue = ((string)value).Replace("%", "");
            double opacity  = CommonConvert.ToDouble(optValue) / 100.0;

            opacity = opacity <= 0 ? 0.005 : opacity;

            return(opacity);
        }
Beispiel #2
0
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            bool result = CommonConvert.ToBoolean(value);

            if (CommonConvert.ToBoolean(parameter, true))
            {
                return(result ? Visibility.Visible : Visibility.Collapsed);
            }
            else
            {
                return(result ? Visibility.Collapsed : Visibility.Visible);
            }
        }
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            int opacity = (int)(CommonConvert.ToDouble(value) * 100);

            return(opacity.ToString() + "%");
        }
Beispiel #4
0
 public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
 {
     return(CommonConvert.ToDouble(value) == CommonConvert.ToDouble(parameter));
 }