【发布时间】:2011-11-09 00:56:10
【问题描述】:
我无法从列表框中选择所需的项目 (当我单击该列表框中的任何项目时,会选择多个项目,但不会选择我单击的项目)。所选项目的背景颜色也将更改为默认(白色)颜色。 我使用的Xaml代码如下:
<ListBox x:Uid="lst_value" Name="lstValues" Background="Wheat"
BorderBrush="Black" HorizontalAlignment="Left" VerticalAlignment="Top"
BorderThickness="1" Height="100" Width="150" ItemsSource="{Binding listval}">
<ListBox.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Vertical" Background="Wheat">
<TextBlock x:Name="txtblk" Foreground="Black" FontSize="10"
TextAlignment="Left" FontWeight="Black" Text="{Binding}"
Background="Wheat"/>
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
谁能告诉我如何解决这个问题。
【问题讨论】: