What i cant seem to do is override the contenttemple, or content in XAML. Is this possible? (none of the properties seem to have any effect what is displayed).
Im using this component because i need fine control over the duration and other propeties that the framework doesnt support out of the box.
6 Answers, 1 is accepted
There should be no problem to set a template for the tool tip. You need to use the ToolTipContentTemplate property of the RadToolTipService:
I have tested the code above in a Silverlight 4 project and it works as expected.
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
We have some elements with tooltips which sometimes become "obscured", i.e. there's an "overlay" (rectangle with some opacity) painted over them. When this overlay is visible and you hover over an element "underneath" it, normally a tooltip should not be shown (as you're actually hovering over the rectangle, not the element with which the tooltip is associated):
- with the standard ToolTipService, no tooltip is shown - correct
- with the RadToolTipService, tooltips appear - wrong
Any idea why this might happen...or maybe it's intentional?
p.s.: looking in the code, it looks like this is because the mousemove event is hooked on the root visual and in the handler the coordinates of the tooltip-enabled elements are checked directly. Any reason why mouseenter/leave are not hooked on the tooltip-enabled elements themselves? Or...why ALL the elements returned by GetElementsInHostCoordinates() are taken into account and not just the first/topmost one?
So, I removed the MouseMove hook on RootVisual altogether and instead, on the SetToolTipContent() call, I hook the MouseEnter/MouseLeave events of the tooltip owner and call the OnMouseEnterElement()/OnMouseLeaveElement() methods. This seems to work fine.
Could you please give me some feedback whether this is a feasible approach? Or maybe you already know some drawback to it (since you didn't choose to use it)?
RadToolTip service was designed to create a feature rich framework for tooltips for our controls that works the same way both in Silverlight and WPF. It is important to note that it is not a standalone product and it was created to support the radcontrols infrastructure, therefore we cannot provide support for its usages outside radcontrols. However you can still use it in you application but with no guarantees.
The reason why we choose to use mouse move on the root visual instead of mouse enter / leave was because of scenarios with nested items (the treemap) in which the framework way of showing tooltips doesn't work correctly. The RadToolTip can be used separately from the RadToolTipService, so you can write your own code that opens a radToolTip.
Hope this information helps!
the Telerik team
Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.
But now i wish to access this template from code using the
Could i get an example of usage, please?
I am not sure I followed you completely. Do you need to retrieve the DataTemplate from the user control resources? You can get it like this:
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>