Exemple #1
0
 private void ProcessCategoryData() {
   _categoryValues.Clear();
   if (this.DataSource != null && !string.IsNullOrEmpty(CategoryValueMemberPath)) {
     BindingEvaluator eval = new BindingEvaluator(CategoryValueMemberPath);
     foreach (object dataItem in this.DataSource) {
       _categoryValues.Add(eval.Eval(dataItem).ToString());
     }
   }
 }
Exemple #2
0
 private void SetData() {
   titles.Clear();
   values.Clear();
   if (!string.IsNullOrEmpty(TitleMemberPath) && !string.IsNullOrEmpty(ValueMemberPath)) {
     BindingEvaluator titleEval = new BindingEvaluator(TitleMemberPath);
     BindingEvaluator valueEval = new BindingEvaluator(ValueMemberPath);
     foreach (object dataItem in this.DataSource) {
       titles.Add(titleEval.Eval(dataItem).ToString());
       values.Add(Convert.ToDouble(valueEval.Eval(dataItem)));
       if (dataItem is INotifyPropertyChanged) {
         (dataItem as INotifyPropertyChanged).PropertyChanged -= OnDataSourceItemPropertyChanged;
         (dataItem as INotifyPropertyChanged).PropertyChanged += new PropertyChangedEventHandler(OnDataSourceItemPropertyChanged);
       }
     }
     total = values.Sum();
   }
 }