Exemple #1
0
 public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
 {
     if (ConverterUtil.SafeConvert(value, out double x) && ConverterUtil.SafeConvert(parameter, out double y))
     {
         return(x / y);
     }
     return(value);
 }
Exemple #2
0
 public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
 {
     if (ConverterUtil.SafeConvert(value, out double x))
     {
         bool paramDouble = ConverterUtil.SafeConvert(parameter, out double y);
         if (!paramDouble)
         {
             y = 5 / 3;
         }
         return(y * (x + 4));
     }
     return(0);
 }
Exemple #3
0
 public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
 {
     if (ConverterUtil.SafeConvert(value, out double x))
     {
         bool paramDouble = ConverterUtil.SafeConvert(parameter, out double y);
         if (!paramDouble)
         {
             y = 0.6;
         }
         double fontSize = x * y - 4;
         return(fontSize > 8 ? fontSize : 8);
     }
     return(20);
 }