Version

Events

What You Will Accomplish

You will handle the events raised by the xamTreemap control.

Follow These Steps

  1. Add the xamTreemap control to your WPF application. For more info on this, see Adding xamTreemap Using XAML Code, Adding xamTreemap Using Procedural Code, or Adding xamTreemap Using Expression Blend.

  2. Handle the events:

In XAML:

<ig:xamTreemap
    x:Name="Treemap"
    NodeMouseLeftButtonDown="Treemap_NodeMouseLeftButtonDown"
    NodeMouseLeftButtonUp="Treemap_NodeMouseLeftButtonUp"
    NodeMouseRightButtonDown="Treemap_NodeMouseRightButtonDown"
    NodeMouseRightButtonUp="Treemap_NodeMouseRightButtonUp"
    NodeMouseDoubleClick="Treemap_NodeMouseDoubleClick"
    NodeMouseMove="Treemap_NodeMouseMove"
    NodeMouseWheel="Treemap_NodeMouseWheel"
    LayoutTypeChanged="Treemap_LayoutTypeChanged"
    LayoutOrientationChanged="Treemap_LayoutOrientationChanged"
    ErrorMessageDisplaying="Treemap_ErrorMessageDisplaying" />
xamTreemap Events 01.png

In Visual Basic:

Private Sub Treemap_NodeMouseLeftButtonDown _
(ByVal sender As Object, ByVal e As TreemapNodeClickEventArgs)
    Dim message As String = e.Node.Text
End Sub
Private Sub Treemap_NodeMouseLeftButtonUp _
(ByVal sender As Object, ByVal e As TreemapNodeClickEventArgs)
    Dim message As String = e.Node.Text
End Sub

Private Sub Treemap_NodeTap _(ByVal sender As Object, ByVal e As TreemapNodeTapEventArgs)    Dim message As String = e.Node.TextEnd Sub
Private Sub Treemap_NodeMouseRightButtonDown _
     (ByVal sender As Object, ByVal e As TreemapNodeClickEventArgs)
Dim message As String = e.Node.Text
End Sub
Private Sub Treemap_NodeMouseRightButtonUp _
(ByVal sender As Object, ByVal e As TreemapNodeClickEventArgs)
    Dim message As String = e.Node.Text
End Sub
Private Sub Treemap_NodeMouseDoubleClick _
(ByVal sender As Object, ByVal e As TreemapNodeClickEventArgs)
    Dim message As String = e.Node.Text
End Sub
Private Sub Treemap_NodeMouseMove _
(ByVal sender As Object, ByVal e As TreemapNodeMouseEventArgs)
    Dim message As String = e.Node.Text
End Sub
Private Sub Treemap_NodeMouseWheel _
(ByVal sender As Object, ByVal e As TreemapNodeMouseWheelEventArgs)
    Dim delta As int = e.MouseEventArgs.Delta
End Sub
Private Sub Treemap_LayoutTypeChanged _
(ByVal sender As Object, ByVal e As LayoutTypeChangedEventArgs)
    Dim layoutType As String = e.NewLayoutType.ToString()
End Sub
Private Sub Treemap_LayoutOrientationChanged _
(ByVal sender As Object, ByVal e As LayoutOrientationChangedEventArgs)
    Dim layoutOrientation As String = e.NewLayoutOrientation.ToString()
End Sub
Private Sub Treemap_ErrorMessageDisplaying _
     (ByVal sender As Object, ByVal e As ErrorMessageDisplayingEventArgs)
Dim errorMessage As String = e.ErrorMessage
End Sub

In C#:

private void Treemap_NodeMouseLeftButtonDown
(object sender, TreemapNodeClickEventArgs e)
{
    string message = e.Node.Text;
}
private void Treemap_NodeMouseLeftButtonUp
(object sender, TreemapNodeClickEventArgs e)
{
    string message = e.Node.Text;
}
private void Treemap_NodeTap(object sender, TreemapNodeTapEventArgs e){  string message = e.Node.Text;}
private void Treemap_NodeMouseRightButtonDown
(object sender, TreemapNodeClickEventArgs e)
{
    string message = e.Node.Text;
}
private void Treemap_NodeMouseRightButtonUp
(object sender, TreemapNodeClickEventArgs e)
{
    string message = e.Node.Text;
}
private void Treemap_NodeMouseDoubleClick
(object sender, TreemapNodeClickEventArgs e)
{
    string message = e.Node.Text;
}
private void Treemap_NodeMouseMove
(object sender, TreemapNodeMouseEventArgs e)
{
    string message = e.Node.Text;
}
private void Treemap_NodeMouseWheel
(object sender, TreemapNodeMouseWheelEventArgs e)
{
    int delta = e.MouseEventArgs.Delta;
}
private void Treemap_LayoutTypeChanged
(object sender, LayoutTypeChangedEventArgs e)
{
    string layoutType = e.NewLayoutType.ToString();
}
private void Treemap_LayoutOrientationChanged
(object sender, LayoutOrientationChangedEventArgs e)
{
    string LayoutOrientation = e.NewLayoutOrientation.ToString();
}
private void Treemap_ErrorMessageDisplaying
(object sender, ErrorMessageDisplayingEventArgs e)
{
    string errorMessage = e.ErrorMessage;
}
  1. Save and run your WPF application.