我有以下问题。当我尝试为切换按钮设置工具提示样式时,我不断收到“工具提示”不能有逻辑或视觉父错误。什么地方出了错?当我取出 ToggleButton.ToolTip 下的工具提示控件时,它起作用了!
<ToggleButton x:Name="toggle" OverridesDefaultStyle="True" Template="{StaticResource ExpanderToggleButton}" Margin="0,4,0,0" VerticalAlignment="Top" IsChecked="{Binding IsExpanded, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}">
<ToggleButton.ToolTip>
<ToolTip Style="{StaticResource tooltipstyle}">
<TextBlock Background="Transparent"/>
</ToolTip>
</ToggleButton.ToolTip>
</ToggleButton>
Run Code Online (Sandbox Code Playgroud) wpf-controls ×1