WPF tooltip 根据父元素属性决定是否显示
例如:Placement为disable的时候,需要显示一段tooltip, 而当Placement为enable的时候,不显示
<Button Grid.Row="2" x:Name="btnNewFolder" Style="{StaticResource NewFolderButtonStyle}" Margin="24,10,0,10" Click="btnNewFolder_Click" Visibility="{Binding IsShowFileTreeNewFolderButton,Converter={StaticResource visiblityConverter}}" ToolTipService.ShowOnDisabled="True"> <Button.ToolTip> <ToolTip Content="{StaticResource IDS_CREATE_FOLDER_TIPS}" > <ToolTip.Style> <Style TargetType="{x:Type ToolTip}" BasedOn="{StaticResource NormalTooltipStyle}"> <Style.Triggers> <DataTrigger Binding="{Binding Path=PlacementTarget.IsEnabled, RelativeSource={RelativeSource Self}}" Value="True"> <Setter Property="Visibility" Value="Collapsed"/> </DataTrigger> </Style.Triggers> </Style> </ToolTip.Style> </ToolTip> </Button.ToolTip> </Button>