paparazzo
paparazzo

Reputation: 45106

ToolTip Style ToolTipService.ShowDuration

The Property ToolTipService.ShowDuration is not effected
The other properties are set
How to set ToolTipService.ShowDuration via a Style?

<Style TargetType="ToolTip">
       <Setter Property="FontFamily" Value="Segoe UI SemiLight" />
       <Setter Property="ToolTipService.ShowDuration" Value="20000" />
       <Setter Property="Foreground" Value="{StaticResource BrushLightBlue}" />
</Style>

Specifically I am having this problem with a MenuItem

Upvotes: 2

Views: 2010

Answers (1)

Ignatius
Ignatius

Reputation: 1177

TooltipService.ShowDuration attached property should be set on the element having the ToolTip. For instance:

<Style TargetType="{x:Type Button}">
    <Setter Property="ToolTipService.ShowDuration" Value="20000" />
</Style>

For a MenuItem this should work

<Style TargetType="Menu">
    <Style.Resources>
        <Style TargetType="MenuItem">
            <Setter Property="ToolTipService.ShowDuration" Value="20000"/>
        </Style>
    </Style.Resources>
</Style>

Upvotes: 4

Related Questions