Neither Popup nor ToolTip content will inherit font element properties, not even from the XAML page root element. This is because the tooltip objects are displayed above the Silverlight controls when displayed. If you want to style the tooltip or to apply Multiline enabled tooltip, you need to use the TextBlock or any other control as per your requirement.
Static Way - Multiline ToolTip
- Appending Hexadecimal Value to represent a Literal
- Including a TextBlock inside the ToolTipService tag
In the above example we have seen the static way of applying the MultiLine tooltip. In the hexadecimal way we need to append the characters along with the text as shown in the screen shot. In the second example we need to apply the TextWrapping properties of the TextBlock.
Dynamic Way - Multiline ToolTip
- Appending Environment.NewLine
- Appending \r and \n
In the above examples we have seen the dynamic way of applying the tooltip. Either you can use the Environment.NewLine or you can use the new line character as shown in the above code.
From the above code snippets, hope you can easily implement the MultiLine tooltip in your Silverlight application.
Join the conversation! Your thoughts help the community grow.