Пример #1
0
 public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
 {
     if (value is Single)
     {
         ColorLabelAndProcessBar control = (ColorLabelAndProcessBar)parameter;
         Color color = control.GetProcessColor();
         return(new SolidColorBrush(color));
     }
     return(null);
 }
Пример #2
0
 public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
 {
     if (value is Single)
     {
         Single process = (Single)value;
         ColorLabelAndProcessBar control    = (ColorLabelAndProcessBar)parameter;
         Int32 percentNumberOfDecimalPlaces = control.PercentNumberOfDecimalPlaces;
         return(String.Format("{0}%", (process * 100).ToString("N" + percentNumberOfDecimalPlaces)));
     }
     return(null);
 }