In my Silverlight 4 app, I have a few long tooltips. By default, these tooltips show one very long line. For example:
<TextBox Text="Test1" ToolTipService.ToolTip="One tasdg asdg as da sdg asdg asdg asdg asd gas dg a sdg a sdg a sd a sd g asdasdgasdg sadgasdgasdg asdg asdg asd as a sd ga sdg asd g asd g asd g asdgasdg asdgasdg"/>
I would like to make tooltips appear on multiple lines. One way to achieve this is to define a tooltip using a TextBlock. For example:
<TextBox Text="Test2"> <ToolTipService.ToolTip> <TextBlock TextWrapping="Wrap" Width="200" Text="One tasdg asdg as da sdg asdg asdg asdg asd gas dg a sdg a sdg a sd a sd g asdasdgasdg sadgasdgasdg asdg asdg asd as a sd ga sdg asd g asd g asd g asdgasdg asdgasdg"/> </ToolTipService.ToolTip> </TextBox>
To do this for each control that I want to define a tooltip seems to be a lot of work. Ideally, I would like to define tooltips as strings similar to the first example, and then apply the style that applies to all tooltips around the world, which will make tooltips. So in my App.xaml, I would define something like this:
<Style TargetType="ToolTip"> </Style>
Any tips on how I can do this?
coding-style tooltip silverlight textwrapping
Geoff hardy
source share