Hello,
I would like to change the TreeNode Icon in dependence of a value from my object property.
I tried somethinglike this....
<ig:XamDataTree Name="_tv" > <ig:XamDataTree.GlobalNodeLayouts> <ig:NodeLayout Key="ChildNodes" TargetTypeName="ChildNodes" DisplayMemberPath="Name" > <ig:NodeLayout.ExpandedIconTemplate> <DataTemplate > <Image Name="NodeIconExpanded" Source="" /> <DataTemplate.Triggers> <DataTrigger Binding="{Binding Path=TypeIdentifier}" Value="-1145171588"> <Setter TargetName="NodeIconExpanded" Property="Source" Value="/example;component/images/image1.png" /> </DataTrigger> <DataTrigger Binding="{Binding Path=TypeIdentifier}" Value="-167182914"> <Setter TargetName="NodeIconExpanded" Property="Source" Value="/example;component/images/image2.png" /> </DataTrigger> </DataTemplate.Triggers> </DataTemplate> </ig:NodeLayout.ExpandedIconTemplate> <ig:NodeLayout.CollapsedIconTemplate> <DataTemplate> <Image Name="NodeIconCollapsed" Source="" /> <DataTemplate.Triggers> <DataTrigger Binding="{Binding Path=TypeIdentifier}" Value="-1145171588"> <Setter TargetName="NodeIconCollapsed" Property="Source" Value="/example;component/images/image1a.png" /> </DataTrigger> <DataTrigger Binding="{Binding Path=TypeIdentifier}" Value="-167182914"> <Setter TargetName="NodeIconCollapsed" Property="Source" Value="/example;component/images/image2a.png" /> </DataTrigger> </DataTemplate.Triggers> </DataTemplate> </ig:NodeLayout.CollapsedIconTemplate> </ig:NodeLayout> </ig:XamDataTree.GlobalNodeLayouts> </ig:XamDataTree>
The tree will display but without any Images, the property binding to my object propertie "TypeIdentifier"should be correct, because with the Microsoft treeview it will work, but there is to slowly.
with friendly greetings from germany
Thomas
Hello Thomas,
Thank you for contacting Infragistics!
I looked over your problem and put together a sample to illustrate one method of setting the buttons. I utilize an IValueConverter to handle the TypeIdentifier property and return a proper image source for the icon.
Please take a look at the attached sample and let me know if you have any questions!
Cheers,JonInfragistics, Inchttp://ko.infragistics.com/help
Hello Jon,
thanks for your support, it seems like your example is for Silverlight, not for WPF. The project doesn't load correctly.
But your hint with the IValueConverter works fine, it is a other solution as a trigger, but it works fine.