I had created a style for ToolTip and I applied it for a button. But it is not applying and displays System.Windows.Style as a ToolTip. The following is the ToolTip Style which I created.
<
Style x:Key="ToolTipStyle1" TargetType="{x:Type ToolTip}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ToolTip}">
<Border Height="Auto" Width="200" BorderThickness="2" BorderBrush="#FFB79700" CornerRadius="3">
<StackPanel Background="{StaticResource ToolTipBackGround}">
<StackPanel Height="25" Width="200" Orientation="Horizontal" HorizontalAlignment="Left" VerticalAlignment="Top" Background="{StaticResource ToolTipHeaderBG}">
<Image x:Name="ImgToolTipIcon" VerticalAlignment="Top" Width="30" Height="22" Source="{Binding ToolTipIcon}" />
<TextBlock Foreground="Black" TextWrapping="Wrap" VerticalAlignment="Top" Margin="2,4,4,0" Height="18" Width="Auto" HorizontalAlignment="Right">
<Run x:Name="RunHeaderText" FontFamily="Andalus" FontSize="14" FontWeight="Bold" Text="{Binding ToolTipHeader}"/>
</TextBlock>
</StackPanel>
<StackPanel Width="200" Orientation="Horizontal" HorizontalAlignment="Left" VerticalAlignment="Top" >
<TextBlock TextWrapping="Wrap" Foreground="#FFF9F4F4" TextAlignment="Center" Background="{x:Null}" HorizontalAlignment="Right" VerticalAlignment="Top" Width="181" Height="Auto">
<Run x:Name="RunBodyText" FontFamily="Verdana" FontSize="11" FontWeight="Normal" Foreground="#FF151514" Text="{Binding ToolTipText}"/>
</TextBlock>
</StackPanel>
</StackPanel>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
I had applied the style in the following code:
<
Button Content="Show Tool Tip" Height="23" Margin="288,226,0,0" Name="Button2" VerticalAlignment="Top" HorizontalAlignment="Left" Width="85" ToolTip="{StaticResource ToolTipStyle1}" />
Please let me know any mistakes available in the Style.
Thanks & Regards
Azharshah H