我正在使用 WPF 列表视图。我的要求是在列表视图项上显示工具提示。以下 XAML 对我有用。
<ListView Height="174" HorizontalAlignment="Left" ItemsSource="{Binding SystemsList}" Margin="12,27,0,0" Name="listView1" VerticalAlignment="Top" Width="456">
<ListView.View>
<GridView>
<GridViewColumn Header="System Name" Width="Auto" DisplayMemberBinding="{Binding SystemName}"/>
<GridViewColumn Header="Network Name" Width="Auto" DisplayMemberBinding="{Binding SystemComputerName}"/>
<GridViewColumn Header="IP Address" Width="Auto" DisplayMemberBinding="{Binding SystemIPAddress}"/>
</GridView>
</ListView.View>
<ListView.ItemContainerStyle>
<Style TargetType="{x:Type ListViewItem}">
<Style.Triggers>
<DataTrigger Binding="{Binding Path=MaxConnectionsLimitReached}" Value ="true" >
<Setter Property="IsEnabled" Value="False"/>
</DataTrigger>
</Style.Triggers>
<Setter Property="ToolTip" Value="{Binding Path=ToolTip1}" />
</Style>
</ListView.ItemContainerStyle>
</ListView>
但是我该如何完成以下
1) 禁用行不显示工具提示。如何展示它?
2)我想隐藏某些行的工具提示。