I would like to set ToolTip maxwidth property to show long texts properly. In addition I need text wrapping. I used this style:
<Style TargetType="ToolTip">
<Setter Property="ContentTemplate">
<Setter.Value>
<DataTemplate>
<StackPanel>
<TextBlock Text="{Binding}" MaxWidth="400" TextWrapping='Wrap' />
</StackPanel>
</DataTemplate>
</Setter.Value>
</Setter>
</Style>
This tooltip style is OK for my purpose. However, it is not effective for some controls which has own tooltip style. For example, tooltip of following button can not appear.
<Button>
<Button.ToolTip>
<StackPanel>
<TextBlock Style="{StaticResource firstText}" Text="aaaaaaaaaaaaa"/>
<TextBlock Style="{StaticResource secondText}" Text="bbbbbbbbbbbbb"/>
<TextBlock Bacground="Red" Text="ccccccccccccc"/>
</StackPanel>
</Button.ToolTip>
</Button>
I want to set maxwidth property with text wrapping for all tooltips. What can i do for this issue?
Following style of ToolTip is useful for me:
With this style, tooltip of following button appears properly: