New Silverlight Video Tutorial: How to Create a ToolTip with a Delay


Have you ever needed to have your Silverlight Object’s ToolTip appear after a delay?  Say, two seconds?  Well, if you have done this in WPF you know that it is quite easy but not so for Silverlight.  Until Microsoft adds that property we are just out of luck, or are we? 

Well, after some research I found THIS project on CodePlex called the Advanced ToolTip project.  The author, someone named XavierDecoster has extended the ToolTipService class and added a property called InitialDelay that sets the time before the ToolTip will appear and one called DelayTime that will set how long the ToolTip shows before it disappears.  AWESOME!

So, I made a short, 7 minute video tutorial that shows you how to use this awesome ToolTipService. 

Watch the video here: http://tinyurl.com/2bbklrk

Download my source here (the Silverlight.Controls.dll can be found in it): http://tinyurl.com/23pxxzw

About these ads
  1. Hi Victor,

    this is a great tipp and another cool video!

    Regarding the topic of a ToolTip with a delaytime: It is possible to achieve a similar effect with styling/templating a regular Silverlight ToolTip. For Silverlight 3 I contributed an example of a styled ToolTip to the Expression Gallery a while ago (http://gallery.expression.microsoft.com/en-us/EasingToolTipStyle). That styled ToolTip appears with an easing and fades out smoothly. Using the same technique one can also implement a delaytime.

    Best regards,
    Martin

    • Hello Martin,
      After looking at your example, downloading the sample and pouring through your code I realize you are absolutely correct! Thanks so much; you have taught me something new. I also really liked your other tutorials such as the Flexible Surface. Awesome stuff!

      So I have a quick question for you: If I made a ToolTip with a Style (like you have done in your sample) and add a VisualState for Open and Closed will the ToolTip automatically run these because of their names (Key to be more technical)?

      Again, thanks for your input! I will make use of this in the future!

      Victor

    • Martin, I tried to do what you said and the ToolTip appears to ignore the BeginTime property on my Storyboard inside of my Open VisualState. You were suggesting that I use that property, right? If not, maybe you can help me out with some more tips. Thanks! Victor

      • LOL, forgive me, I was wrong. If I set the Root of the ControlTemplate to an Opacity of 0 and then add this Open visualState:

        // WordPress is omitting my code but know that it DOES work.

        It works perfectly! Thank you so much! This is a great solution to my problem.

  2. Hi Victor,

    sorry for my late reply but I didn’t recieve an email notification on your comment.

    I am very pleased with your kind words. Your words are a big payment to me since (unfortunately) programming is only a pastime to me. And let me say that I learned a thousand things from you and your great work for the community. Thank YOU!

    Flexible Surface is realy cool stuff. The best thing is that it is so easy to implement. Imagine this effect in touch applications, for example in a Windows Phone 7 app …

    BTW: The latest on Flexible Surface is a new sample that combines a Flexible Surface with drag & drop interactivity.

    http://gallery.expression.microsoft.com/en-us/DADFSESL4

    Maybe you would want to take a look at it too.

    Kind regards,
    Martin

    • Hello Martin,
      I am so pleased to hear that you, someone who is so amazing at Silverlight, has in the past learned something from me. I am truly touched and proud; so much I even read your comment to my wife. I cannot imagine someone as good as you only does this as a pastime. What do you do for a living? Build spaceships? LOL.

      Anyway, I think your work is amazing and I would love to, if you like add links to all of your tutorials. Of course, I will add them and say they are from you but I get quite a bit of traffic and adding you my all-inclusive tutorial page (found here: http://tinyurl.com/ydngog8) will give you quite a bit of new traffic. I think your work is Top Notch and belongs on a page that gets about 10,000 unique hits per month. If you do not want to then I totally respect you and understand. If you do though shoot me an email at wpfauthor at gmail dot com and let me know. Thank YOU for your community contributions and great work. I know that I, a pretty seasoned Silverlight developer have already learned a great deal from you. I actually implemented your ToolTip delay solution into my professional work! You are a great developer and I think we can learn from each other quite a bit.

      Thanks and I look forward to speaking with you

      Victor

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: