バージョン

イベント

達成すること

xamTreemap コントロールによって発生するイベントを処理します。

以下の手順を実行します。

  1. xamTreemap コントロールを WPF アプリケーションに追加します。これに関する詳細は、 XAML コードを使った xamTreemap の追加 または Procedural コードを使った xamTreemap の追加または、 Expression Blend を使用して xamTreemap を追加を参照してください。 .

イベントの処理:

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

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

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. WPF アプリケーションを保存して実行します。