WPF ToolTip Style
You can set style inline or can create in windows resources with Type. in Type you have to assign ToggleButton .
Inline-
<ToggleButton >
<ToggleButton.ToolTip>
<ToolTip>
<StackPanel>
<TextBlock FontWeight="Bold">TEXT HERE</TextBlock>
<TextBlock>SECOND TEXT HERE.</TextBlock>
</StackPanel>
</ToolTip>
</ToggleButton.ToolTip>
In Window Resource (as describe by @aDoubleSo)
<Window.Resources>
<Style x:Key="{x:Type ToolTip}" TargetType="ToolTip">
<Setter Property="OverridesDefaultStyle" Value="true" />
<Setter Property="HasDropShadow" Value="True" />
</Style>
<Window.Resources>
You have to declare the style and all tooltips of your control will be shown in this style.
<Window.Resources>
<Style x:Key="{x:Type ToolTip}" TargetType="ToolTip">
<Setter Property="OverridesDefaultStyle" Value="true" />
<Setter Property="HasDropShadow" Value="True" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ToolTip">
<!-- define your control template -->
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Window.Resources>
If I understand your question correctly, you want to define a style for ToolTip
within your ToggleButton
.
Try this:
<ToggleButton Content="ON" Grid.Row="1" ToolTip="{Binding ElementName=tbText, Path=Text}">
<ToggleButton.Resources>
<Style TargetType="ToolTip" BasedOn="{StaticResource {x:Type ToolTip}}">
<Setter Property="Background" Value="Red" />
</Style>
</ToggleButton.Resources>
</ToggleButton>