title: Dynamic Data Display with ObservableCollection
body: <p>I dont know how to display some points using ObservableCollection. This is my code:</p>
  
  <pre><code>&lt;Window x:Class="WpfApplication1.MainWindow"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:d3="http://research.microsoft.com/DynamicDataDisplay/1.0"
      Title="MainWindow" Height="350" Width="525"&gt;
  
  &lt;Grid&gt;
  
      &lt;d3:ChartPlotter x:Name="Plotter" Margin="100,5,0,0"&gt;
          &lt;d3:LineGraph /&gt;
      &lt;/d3:ChartPlotter&gt;
  
      &lt;Button x:Name="button"
              Content="Load Graph"
              HorizontalAlignment="Left"
              Margin="10,35,0,0"
              VerticalAlignment="Top"
              Width="70"
              Height="45" Click="button_Click"/&gt;
  
  &lt;/Grid&gt;
  </code></pre>
  
  <p></p>
  
  <pre><code>public partial class MainWindow : Window
  {
      public ObservableCollection&lt;Point&gt; Data { get; set; }
  
      public MainWindow()
      {
          InitializeComponent();
  
          Data = new ObservableCollection&lt;Point&gt;();
          Plotter.DataContext = this;
      }
  
      private void button_Click(object sender, RoutedEventArgs e)
      {
          double[] my_array = new double[10];
  
          for (int i = 0; i &lt; my_array.Length; i++)
          {
              my_array[i] = Math.Sin(i);
              Data.Add(new Point(i, my_array[i]));
          }
      }
  }
  </code></pre>
  
  <p>Could anyone show me how to do this? Probably I have to add something in XAML like ItemsSource="Data" but i couldn't find that one.
  Thank you.</p>