I am working on WPF Charts and want the user to choose a chart series type at run time. If the series type is know at design time, I could have simply declared a variable of the series type like this...
ColumnSeries cs = new ColumnSeries();
cs.ItemsSource = source;
Or would have used a generic series variable and used casting;
((ColumnSeries) is).ItemsSource = source;
Now the problem is I am not only adding series at runtime, but also allowing the users to select the Series type. I could use IF/Switch conditions, but that would not be efficient. How can I declare the data type of the Series variable at runtime.