ItemsControl doesn't work in ChartPlotter

Jun 9, 2011 at 7:14 PM

Hi,

I'm confused about the xaml support for DataTemplate'd LineGraph objects in D3.

I'd like to add a class PointsGraphItemsControl than derives from ItemsControl (and implements IPlotterElement) to specify a ItemTemplate that has a LineGraph correctly bound to my view model. However when I add this to a ChartPlotter the template is never instanticated.

It seems this is because although Plotter is a ContentControl it has the attribute

[ContentProperty("Children")]

Is there any way to force the template to be created?

I will post more when I understand the problem a bit better.

regards,

Danny

 

<c:ChartPlotter Name="plotter">

    <v:PointsGraphItemsControl ItemsSource="{Binding Path=Graphs}">
        <v:PointsGraphItemsControl.ItemTemplate>
            <DataTemplate>
                <c:LineGraph
                    StrokeThickness="2"
                    DataSource="{Binding Path=Points}" >
                    <c:LineGraph.Description>
                        <c:PenDescription DescriptionString="Description"/>
                    </c:LineGraph.Description>
                </c:LineGraph>
            </DataTemplate>
        </v:PointsGraphItemsControl.ItemTemplate>

    </v:PointsGraphItemsControl>                

</c:ChartPlotter>