public object Convert(object value, Type targetType, object parameter, string language) { if (value != null && (value is ChartDataMarkerLabel)) { ChartDataMarkerLabel pieAdornment = value as ChartDataMarkerLabel; int index = pieAdornment.Series.Adornments.IndexOf(pieAdornment); SolidColorBrush brush = pieAdornment.Series.ColorModel.GetBrush(index) as SolidColorBrush; return(ApplyLight(brush.Color)); } return(value); }
public object Convert(object value, Type targetType, object parameter, string language) { if (value != null) { ChartDataMarkerLabel pieAdornment = value as ChartDataMarkerLabel; #pragma warning disable CA1305 // Specify IFormatProvider return(String.Format((pieAdornment.Item as Populations).States)); #pragma warning restore CA1305 // Specify IFormatProvider } return(null); }
public object Convert(object value, Type targetType, object parameter, string language) { ChartDataMarkerLabel pieAdornment = value as ChartDataMarkerLabel; if (pieAdornment == null) { return(value); } var model = pieAdornment.Item as Populations; if (model != null) { #pragma warning disable CA1305 // Specify IFormatProvider return(String.Format(model.Countries + " : " + pieAdornment.YData)); #pragma warning restore CA1305 // Specify IFormatProvider } else { var list = pieAdornment.Item as List <object>; string labelData = ""; for (int i = 0; i < list.Count; i++) { var item = list[i] as Populations; #pragma warning disable CA1305 // Specify IFormatProvider labelData = labelData + String.Format(item.Countries + " : " + item.Count); #pragma warning restore CA1305 // Specify IFormatProvider if (i + 1 != list.Count) { labelData = labelData + Environment.NewLine; } } return(labelData); } }