This project is read-only.
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 11:58 AM by XavierDecoster, version 6

Comments

ravikanth143 Sep 2, 2013 at 2:45 PM 
When i have tooltip in a grid rows and scroll grid with mouse wheel, silverlight screen becomes blank. Error is "servers must include a date response header RFC2616".

Detailed error is
Message: Unhandled Error in Silverlight Application Error HRESULT E_FAIL has been returned from a call to a COM component. at MS.Internal.XcpImports.CheckHResult(UInt32 hr)

at MS.Internal.XcpImports.SetValue(IManagedPeerBase obj, DependencyProperty property, Boolean b)
at System.Windows.DependencyObject.SetValue(DependencyProperty property, Boolean b)

at System.Windows.Controls.ToolTip.BeginClosing()
at System.Windows.Controls.ToolTip.OnIsOpenChanged(Boolean isOpen)

at System.Windows.Controls.ToolTip.OnIsOpenPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)

at System.Windows.DependencyObject.RaisePropertyChangeNotifications(DependencyProperty dp, Object oldValue, Object newValue)

at System.Windows.DependencyObject.UpdateEffectiveValue(DependencyProperty property, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, ValueOperation operation)

at System.Windows.DependencyObject.SetValueInternal(DependencyProperty dp, Object value, Boolean allowReadOnlySet, Boolean isBindingInStyleSetter)

at System.Windows.DependencyObject.SetValue(DependencyProperty property, Boolean b)
at System.Windows.Controls.ToolTip.set_IsOpen(Boolean value)

at Silverlight.Controls.ToolTips.ToolTipService.OnDataContextChanged(DependencyObject sender, DependencyPropertyChangedEventArgs args)

at System.Windows.DependencyObject.RaisePropertyChangeNotifications(DependencyProperty dp, Object oldValue, Object newValue)

at System.Windows.DependencyObject.UpdateEffectiveValue(DependencyProperty property, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, ValueOperation operation)

at System.Windows.DependencyObject.RefreshExpression(DependencyProperty dp)
at System.Windows.Data.BindingExpression.SendDataToTarget()

at System.Windows.Data.BindingExpression.SourceAcquired()

at System.Windows.Data.BindingExpression.System.Windows.IDataContextChangedListener.OnDataContextChanged(Object sender, DataContextChangedEventArgs e)

at System.Windows.Data.BindingExpression.DataContextChanged(Object sender, DataContextChangedEventArgs e)

at System.Windows.DataContextChangedEventHandler.Invoke(Object sender, DataContextChangedEventArgs e)

at System.Windows.FrameworkElement.OnDataContextChanged(DataContextChangedEventArgs e)

at System.Windows.FrameworkElement.OnAncestorDataContextChanged(DataContextChangedEventArgs e)

at System.Windows.FrameworkElement.NotifyDataContextChanged(DataContextChangedEventArgs e)

at System.Windows.FrameworkElement.OnTreeParentUpdated(DependencyObject newParent, Boolean bIsNewParentAlive)

at System.Windows.DependencyObject.UpdateTreeParent(IManagedPeer oldParent, IManagedPeer newParent, Boolean bIsNewParentAlive, Boolean keepReferenceToParent)

at MS.Internal.FrameworkCallbacks.ManagedPeerTreeUpdate(IntPtr oldParentElement, IntPtr parentElement, IntPtr childElement, Byte bIsParentAlive, Byte bKeepReferenceToParent,
Boolean canCreateParent)
Line: 1
Char: 1
Code: 0

Mivoat Mar 19, 2012 at 7: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 11: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 7: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 4:13 PM 
This is, quite possibly, the smoothest, easiest custom silverlight control I have ever used. Thanks so much...perfect solution to my problems!