views:

101

answers:

0

Hi,

I am trying to bind some diagrams to a dictionary of string, int, and I am using a view-viewmodel pattern.

I have bound the dictionary already to a bar-diagram, but now I would like to bind it to the treemap control from the WPF Toolkit. It's not really documented anywhere online, except here for silverlight: http://blogs.msdn.com/marlat/archive/2009/07/10/treemap-control-comes-to-silverlight-toolkit.aspx

Can anyone help me fix the right binding to my control?

<DataVisualization:TreeMap x:Name="treeMapControl">

                            <DataVisualization:TreeMap.Interpolators>

                                <DataVisualization:SolidColorBrushInterpolator TargetName="itemBorder" TargetProperty="Background"

                                       DataRangeBinding="{Binding Source={StaticResource ShellVM},Path=CustodianEmailCount.Value}" From="Blue" To="Magenta" />

                                <DataVisualization:DoubleInterpolator TargetName="textBlk" TargetProperty="FontSize"

                                       DataRangeBinding="{Binding Source={StaticResource ShellVM},Path=CustodianEmailCount.Value}" From="8" To="15" />

                            </DataVisualization:TreeMap.Interpolators>



                            <DataVisualization:TreeMap.ItemDefinition>

                                <DataVisualization:TreeMapItemDefinition ItemsSource="{Binding Source={StaticResource ShellVM},Path=CustodianEmailCount.Key}" ValueBinding="{Binding Source={StaticResource ShellVM},Path=CustodianEmailCount.Value}" ChildItemPadding="1">

                                    <DataTemplate>

                                        <Border x:Name="itemBorder" BorderBrush="Black" BorderThickness="1" ToolTipService.ToolTip="{Binding ToolTip}">

                                            <TextBlock x:Name="textBlk"  Foreground="White" Text="{Binding Source={StaticResource ShellVM},Path=CustodianEmailCount.Key}" VerticalAlignment="Center" Margin="2,2,0,0"

                                   TextWrapping="Wrap" TextAlignment="Center"/>

                                        </Border>

                                    </DataTemplate>

                                </DataVisualization:TreeMapItemDefinition>

                            </DataVisualization:TreeMap.ItemDefinition>

                        </DataVisualization:TreeMap>