title: Windows 8 XAML/C# - How to draw dynamic elements on a canvas?
body: <p>I have canvas control I'm using for a graph and need to be able to dynamically add a variable amount of data points to it. Maybe I'm not aware of a good control to do this type of thing with but I was trying to do it with a GridView as such:</p>
  
  <pre><code>&lt;Canvas x:Name="GraphPointsAndLines" Canvas.ZIndex="2"&gt;
          &lt;GridView x:Name="gvDataPoints"&gt;
              &lt;GridView.ItemTemplate&gt;
                  &lt;DataTemplate&gt;
                      &lt;Button IsEnabled="False" Canvas.Left="{Binding PointXValue}" Canvas.Top="{Binding PointYValue}" Content="{Binding Value}" Style="{StaticResource ButtonGraphPoint}" /&gt;
                  &lt;/DataTemplate&gt;
              &lt;/GridView.ItemTemplate&gt;
          &lt;/GridView&gt;
      &lt;/Canvas&gt;
  </code></pre>
  
  <p>But due to the nature of the gridview it's not recognizing that the child button elements are a part of any such canvas and just ends up stacking them on top of one another. Can anyone offer any suggestions?</p>