Infragistics(R) NetAdvantage(R) : WPF 2012.1
xamTagCloud Events
E-mail your feedback on this topic.
Shared XAML > Menus > xamTagCloud > Using xamTagCloud > xamTagCloud Events

Glossary Item Box

The xamTagCloud™ control exposes two item-related events. You can handle these events to perform custom logic after a specific action occurs.

The following code demonstrates how to handle the xamTagCloudItemClicked and the xamTagCloudClipped event.

In XAML:

<Grid x:Name="LayoutRoot" Background="White">
   <ig:XamTagCloud MaxScale="2" MinScale="1" Name="myTagCloud" XamTagCloudClipped="xamTagCloud_xamTagCloudClipped" XamTagCloudItemClicked="xamTagCloud_xamTagCloudItemClicked">
...
   </ig:XamTagCloud>
</Grid>

In Visual Basic:

Imports Infragistics.Controls.Menus
Imports Infragistics
...
AddHandler Me.xamTagCloud.xamTagCloudClipped, AddressOf xamTagCloud_xamTagCloudClipped
AddHandler Me.xamTagCloud.xamTagCloudItemClicked, AddressOf xamTagCloud_xamTagCloudItemClicked
...
Private Sub xamTagCloud_xamTagCloudItemClicked(ByVal sender As System.Object, ByVal e As xamTagCloudItemEventArgs)
   System.Diagnostics.Debug.WriteLine("Cloud Item Clicked: Content =" + e.xamTagCloudItem.Content + "Weight " + e.xamTagCloudItem.Weight)
End Sub
Private Sub xamTagCloud_xamTagCloudClipped(ByVal sender As System.Object, ByVal e As xamTagCloudClippedEventArgs)
   System.Diagnostics.Debug.WriteLine("xamTagCloudClipped Event Fired")
End Sub

In C#:

using Infragistics.Controls.Menus;
using Infragistics;
...
this.xamTagCloud.xamTagCloudClipped += new EventHandler<xamTagCloudClippedEventArgs>(XamTagCloud_xamTagCloudClipped);
this.xamTagCloud.xamTagCloudItemClicked += new EventHandler<xamTagCloudItemEventArgs>(XamTagCloud_xamTagCloudItemClicked);
...
void XamTagCloud_xamTagCloudItemClicked(object sender, xamTagCloudItemEventArgs e)
{
   System.Diagnostics.Debug.WriteLine("Cloud Item Clicked: Content =" + e.xamTagCloudItem.Content + "Weight " + e.xamTagCloudItem.Weight);
}

void XamTagCloud_xamTagCloudClipped(object sender, xamTagCloudClippedEventArgs e)
{
   System.Diagnostics.Debug.WriteLine("xamTagCloudClipped Event Fired");
}
Related Topics

Add Cloud Items to xamTagCloud

Add Navigation URIs to Cloud Items

Add Spaces Between Cloud Items

Setting Minimum and Maximum Scale Values

Smooth Scaling

Working with ScaleBreaks Collection