Dependencies
Since it is a Silverlight library (it has only purpose if you reference it from within a Silverlight application or library), you won't have any issues regarding dependencies to other libraries. Internally, it only references the following: mscorlib, system, System.Core and System.Windows.

How to set a persistent ToolTip in Code

toolTip.DisplayTime = Duration.Forever; 
or
toolTip.SetValue(ToolTip.DisplayTimeProperty, Duration.Forever); 

How to set advanced ToolTip properties in XAML

Take a look at the sample code below:
<Controls:ToolTipService.ToolTip>
     <!-- Set the ToolTip display time and initial delay -->
     <Controls:ToolTip DisplayTime="00:00:10" InitialDelay="00:00:03" x:Name="greenTooltip">

          <!-- Set the ToolTip close animation -->
          <Controls:ToolTip.CloseAnimation>
               <Storyboard Duration="00:00:01">
                    <DoubleAnimation From="1" To="0" Storyboard.TargetName="greenTooltip" Storyboard.TargetProperty="Opacity"/>
               </Storyboard>
          </Controls:ToolTip.CloseAnimation>

          <!-- Set the ToolTip open animation -->
          <Controls:ToolTip.OpenAnimation>
               <Storyboard Duration="00:00:01">
                    <DoubleAnimation From="0" To="1" Storyboard.TargetName="greenTooltip" Storyboard.TargetProperty="Opacity"/>
               </Storyboard>
          </Controls:ToolTip.OpenAnimation>

          <!-- Set the ToolTip content -->
          <Controls:ToolTip.Content>
               <StackPanel Margin="5" >
                    <TextBlock Text="This tooltip has a DisplayTime of 10 seconds." />
                    <TextBlock Text="You can put whatever xaml you want in here..." />
               </StackPanel>
          </Controls:ToolTip.Content>
                        
     </Controls:ToolTip>
</Controls:ToolTipService.ToolTip>

A video tutorial can be found here.

More documentation is under construction.

Last edited Sep 25, 2010 at 10:58 AM by XavierDecoster, version 6

Comments

Mivoat Mar 19, 2012 at 6:22 PM 
Is there a way to pin the tooltip - like we do to popup variables in Visual Studio? That would mean being able to add a scroll bar - which I need in my app for huge tooltips my customer wants popping up.
Thanks for a great component, Clive.

geardoom3 Mar 7, 2011 at 10:16 AM 
I have a stack panel vertical which have a TextBlock and then another StackPanel horizontal with 2 TextBlock.

the second textblock on the horizontal StackPanel is set to wrap but it doesn't. Here's the entire code along with a screenshot that shows what it does. How would you modify it so the Note Text wrap and make the ToolTip grow to show all the text because in 1024 X 768, the ToolTip needs to grow vertically if no space is available to show the Note Text

StackPanel spContent = new StackPanel() { Orientation = System.Windows.Controls.Orientation.Vertical, VerticalAlignment = System.Windows.VerticalAlignment.Stretch };
StackPanel spNote = new StackPanel() { Orientation = System.Windows.Controls.Orientation.Horizontal, VerticalAlignment = System.Windows.VerticalAlignment.Stretch };

TextBlock tbHeaderNote = new TextBlock()
{
FontFamily = new FontFamily("Courier New"),
FontSize = 14,
Margin = new Thickness() { Left = 4 },
Foreground = new SolidColorBrush(Colors.White),
TextWrapping = System.Windows.TextWrapping.Wrap,
Text = "Note : "
};

TextBlock tbNote = new TextBlock()
{
FontFamily = new FontFamily("Courier New"),
FontSize = 14,
Margin = new Thickness() { Left = 4 },
Foreground = new SolidColorBrush(Colors.White),
TextWrapping = System.Windows.TextWrapping.Wrap,
Text = ncs.U_Note + Environment.NewLine + Environment.NewLine + Environment.NewLine,
};

spNote.Children.Add(tbHeaderNote);
spNote.Children.Add(tbNote);

TextBlock tbInfo = new TextBlock()
{
FontFamily = new FontFamily("Courier New"),
FontSize = 14,
Margin = new Thickness() { Left = 4 },
Foreground = new SolidColorBrush(Colors.White),
Text = "Interface Control Name : " + ncs.Name + Environment.NewLine +
"Silverlight Property : " + SLProperty + Environment.NewLine +
"Step : " + ncs.U_ApprovalStepId.ToString() + Environment.NewLine +
"SAP Form : " + SAPForm + Environment.NewLine +
"SQL Table Field : " + SQLTableField + Environment.NewLine +
"SDK Property : " + ncs.U_SAPProperty,
TextWrapping = TextWrapping.NoWrap,
};

spContent.Children.Add(tbInfo);
spContent.Children.Add(spNote);

http://pages.videotron.com/gear/tooltip.jpg

geardoom3 Mar 6, 2011 at 6:01 PM 
Works great. Thank you...
Any change to see it in the Silverlight 5 dundle so we don't have an independent dll to keep ?

ginnysmith76 Feb 23, 2011 at 3:13 PM 
This is, quite possibly, the smoothest, easiest custom silverlight control I have ever used. Thanks so much...perfect solution to my problems!