<ig:xamTreemap
x:Name="Treemap"
NodeMouseLeftButtonDown="Treemap_NodeMouseLeftButtonDown">
</ig:xamTreemap>
In this article you will learn how to use xamTreemap™ control’s ItemsSourceRoot property.
The ItemsSourceRoot property allows the user to specify which node of the current DataContext will be set as root.
Create a Microsoft® WPF™ application.
Add an instance of the xamTreemap control to your application.
Handle the NodeMouseLeftButtonDown event:
In XAML:
<ig:xamTreemap
x:Name="Treemap"
NodeMouseLeftButtonDown="Treemap_NodeMouseLeftButtonDown">
</ig:xamTreemap>
In Visual Basic:
Private Sub Treemap_NodeMouseLeftButtonDown _
(ByVal sender As Object, ByVal e As TreemapNodeClickEventArgs)
If Treemap.ItemsSourceRoot <> e.Node.DataContext Then
Treemap.ItemsSourceRoot = e.Node.DataContext
End If
End Sub
In C#:
private void Treemap_NodeMouseLeftButtonDown(object sender, TreemapNodeClickEventArgs e)
{
if (Treemap.ItemsSourceRoot != e.Node.DataContext)
{
Treemap.ItemsSourceRoot = e.Node.DataContext;
}
}
Create custom logic for drilling down and storing the drilled roots.