Project Description
This Silverlight ToolTipService makes it easier to set tooltips on Silverlight controls with a specified delay and display duration. It's developed in C# and delivered as a Silverlight library.
You can set initial delay, fade-out and display duration properties of a ToolTip.

Introduction
It surprised me that a simple option like setting the display time or the initial delay of a ToolTip is still not possible in Silverlight, although these properties are present in their WPF counterpart.

Sometimes, you want some custom ToolTip behavior:
for instance, some ToolTips need to persist as long as the control has focus, or others need a specific display duration (for example 10 seconds), or should only show up after an initial delay of 3 seconds.
The default Silverlight setting is a display time of 5 seconds, and then it’s gone until you mouse out and mouse over the control again.

Optionally, you can also set a custom Storyboard that is triggered when a ToolTips opens or closes, using the OpenAnimation and CloseAnimation properties.

Since Silverlight already provides us with a static ToolTipService class that takes care of the basic ToolTip functionality, I thought it was a good idea to extend its behavior a bit.
Initially.
It didn't take me long until I hit some MS internal exceptions.

Features
That’s how I ended up creating the following custom ToolTipService and custom ToolTip class.
It provides new ToolTip behaviors:
  1. you can set persistent ToolTips: duration = until mouse out (DisplayTime = int.MaxValue)
  2. you can specify the amount of seconds the ToolTip should display (DisplayTime property)
  3. you can specify a Storyboard to be triggered when a ToolTip opens (OpenAnimation property)
  4. you can specify a Storyboard to be triggered when a ToolTip closes (CloseAnimation property)
  5. you can specify an initial delay for the ToolTip (InitialDelay property)
  6. you can databind the ToolTip content

Release
Latest release: Silverlight Advanced ToolTips v2.2.0
Release notes: Changelog

How to use
If you download the source code (Silverlight Advanced ToolTips v2.2.0), you'll have a demo Silverlight application that explains the use of of this library, both from within XAML and in C# code.
Take a look at the sample application here).

There is also a great video tutorial to be found here.
For more documentation on this library, please visit the Documentation tab, or visit my blog for the latest news.

For the moment being, this solution fit’s to provide this behavior.
Ofcourse, if anyone has a better solution for this, please feel free to point us in the right direction with your suggestions and/or remarks.

If you like it, please vote for it on Silverlight Uservoice.

Above all, have fun with Silverlight and I wish you impactful developments!

Last edited Jun 22, 2011 at 7:31 PM by XavierDecoster, version 45