0
我是WPF新手。我有一個WPF列表視圖中的複選框列表。我有功能,當用戶點擊複選框時,它突出顯示該行。所有這一切工作正常。但是,當複選框被禁用時,它仍然會突出顯示該行,並且它也會檢查複選框。我該如何做到這一點,因此它不會突出顯示或檢查用戶何時單擊禁用的複選框?提前致謝。如何禁用在WPF中禁用項目時突出顯示?
<ListView ScrollViewer.ScrollChanged="lstRewardsExpiration_ScrollChanged" Height="178" HorizontalAlignment="Left" Margin="12,0,0,81" Name="lstRewardsEarned" VerticalAlignment="Bottom" Width="327" SelectionMode="Multiple" Background="White" FontFamily="Calibri" FontSize="16">
<ListView.ItemContainerStyle>
<Style TargetType="{x:Type ListViewItem}">
<Setter Property="IsSelected" Value="{Binding Path=IsChecked, Mode=TwoWay}" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ListBoxItem">
<Border x:Name="Border" SnapsToDevicePixels="true">
<ContentPresenter />
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsSelected" Value="True">
<Setter TargetName="Border" Property="Background" Value="Cyan"/>
</Trigger>
<Trigger Property="IsSelected" Value="False">
<Setter TargetName="Border" Property="Background" Value="Transparent"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ListView.ItemContainerStyle>
</ListView>
我沒有看到任何代碼複選框你張貼... – Blachshma 2013-03-12 20:51:37