title: Programmatically create a ColumnSeries WPF Toolkit Charts
body: <p>I am trying to programmatically add a column series to a wpf toolkit chart. My xaml is an empty chart. The code results in an unhandled exception, Object reference not set to an instance of an object. Any clues to why this does not work?</p>
  
  <pre><code>&lt;charting:Chart Name="MyChart"&gt;
  </code></pre>
  
  <p>my code behind is</p>
  
  <pre><code>List&lt;KeyValuePair&lt;int,int&gt;&gt; testList = new List&lt;KeyValuePair&lt;int,int&gt;&gt;();
  
  testList.Add(new KeyValuePair&lt;int,int&gt; (1,2));
  
  testList.Add(new KeyValuePair&lt;int,int&gt; (2,3)); 
  
  ColumnSeries mySeries = new ColumnSeries();
  
  mySeries.Title = "TEST";
  
  
  mySeries.IndependentValueBinding = new Binding("key");
  
  mySeries.DependentValueBinding = new Binding("value");
  
  mySeries.ItemsSource = testList;
  
  MyChart.Series.Add(mySeries);
  </code></pre>