1
:WPF工具提示控件模板没有显示我已经设置了以下控制模板和样式作为我的应用程序的所有工具提示的默认样式内容
<Style TargetType="{x:Type ToolTip}">
<!-- Background="Transparent" BorderBrush="Transparent" BorderThickness="0" HasDropShadow="True" -->
<Setter Property="Background" Value="Transparent" />
<Setter Property="BorderBrush" Value="Transparent" />
<Setter Property="OverridesDefaultStyle" Value="true" />
<Setter Property="Placement" Value="Bottom"></Setter>
<Setter Property="BorderThickness" Value="0" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate>
<Grid Background="{Binding Source={x:Static visualResources:ThemeManager.Instance}, Path=ThemePageColor}" >
<ContentPresenter Margin="3"></ContentPresenter>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
(上面的代码是在Window.Resources)
而且在同一窗口内我有这样的控制:
<Button ToolTip="Tooltip Text!" HorizontalContentAlignment="Right" Height="60" Click="_Button_AddCourse_Click"/>
但是,当我运行程序的提示不会出现,因为他们应该!我只能看到一个橙色的矩形(这是控件模板中的网格,橙色是ThemeManager.Instance.ThemePageColor属性),但工具提示中没有文本。
在此先感谢。
变化'<的ControlTemplate>''到' –
哇这工作。谢谢 :) –