为什么仍启用此工具提示?

问题描述 投票:0回答:1

我正在使用WPF应用,正在尝试有条件地启用工具提示。这很奇怪,我意识到,即使我明确地将工具提示设置为未启用(ToolTipService.IsEnabled =“ False”),工具提示仍然会显示。有人能弄清楚这里发生了什么吗?

 <TextBlock Grid.Row="2"
    Grid.Column="0"
    VerticalAlignment="Center"
    FontSize="15"
    ToolTipService.IsEnabled="False"
    Visibility="{Binding IsConnected, Converter={StaticResource BooleanToVisibilityConverter}}">
    <fa:ImageAwesome Icon="{Binding Path=BatteryLevelIcon, UpdateSourceTrigger=PropertyChanged}"
       Height="20"
       Width="20"
       Foreground="Green"
       Visibility="{Binding IsConnected, Converter={StaticResource BooleanToVisibilityConverter}}" />
    <ToolTipService.ToolTip>
       <TextBlock>
          <TextBlock.Text>
             <MultiBinding StringFormat="{}{0}%">
                <Binding Path="BatteryPercentage" />
             </MultiBinding>
          </TextBlock.Text>
       </TextBlock>
    </ToolTipService.ToolTip>
 </TextBlock>
c# wpf xaml telerik
1个回答
0
投票

设置ToolTipService.ShowOnDisabled = false;

ToolTipService.ShowOnDisabled

© www.soinside.com 2019 - 2024. All rights reserved.