Hello,
I bind control to the ObservableCollection<someobject> and assign NodeBinders. Now I want to assign different styles to each node. Each item has its appearance which I have to apply. How can I do that? Looks like ValueMappers are not for this case. Any ideas?
Thank you.
Looks like binding to the viewmodel style property does the trick:
<Style x:Key="TreemapNodeStyle" TargetType="Charts:TreemapNode"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="Charts:TreemapNode"> <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Fill}" CornerRadius="{TemplateBinding CornerRadius}" Style="{Binding Style}>
<Grid> <Charts:NodesPanel x:Name="NodesPanel" /> </Grid> </Border> </ControlTemplate> </Setter.Value> </Setter> </Style>
At the moment there is no way to specify different style for each node in your Treemap. You can only specify the style for all nodes of one NodeBinder, thus nodes with different NodeBinders will have different styles.
Try looking into the custom value mappers: http://help.infragistics.com/NetAdvantage/DV/2010.3/CLR4.0/?page=xamTreemap_Custom_Value_Mappers.html
You might be able to achieve something similar to what you described using custom value mappers. You can find a sample, that uses custom value mappers at http://labs.infragistics.com/silverlightdv/2010.3/#/Samples/TreeMap/ValueMappers/CustomMapper
You can also submit a request for a new functionality by visiting our feature request page: http://devcenter.infragistics.com/SignIn/SignIn.aspx?ReturnUrl=%2fprotected%2frequestfeature.aspx
Regards,
Boyan