Hello,
I have the following situation: I have an interface IBasicTreeItem which is used as the basic interface for all tree nodes. I also implemented two classes that implement this interface. The classes are NodeTreeItem (for non-leaf nodes) and LeafNodeTreeItem (for leaf nodes).
public interface IBasicTreeItem {
...
IEnumerable<IBasicTreeItem> Children { get; } } public class NodeTreeItem : IBasicTreeItem { ... } public class LeafNodeTreeItem : BasicTreeItem { ... }
The ItemsSource of the XamDataTree binds to a colelction of IBasicTreeItem objects.
In XAML I want to have different layouts for the different types, like for example
<ig:NodeLayout Key="NodeLayout" TargetTypeName="BasicTreeItem">
</ig:NodeLayout>
<ig:NodeLayout Key="LeafNode" TargetTypeName="LeafNodeTreeItem">
Using the standard TreeView and DataTemplates for the above two classes, it is very easy to achieve this. But how can that be done with the XamDataTree?
Thanks a lot in advance,
Raja
This can be achieved by handling the NodeLayoutAssigned event off the tree. During this event you can set the NodeLayout to be used with the particular NodesManager
e)
{
(e.Level == 0)
e.NodeLayout = tree.GlobalNodeLayouts[
];
}
else