【发布时间】:2014-02-07 23:22:09
【问题描述】:
我正在使用 ListBox 列出一组项目,我希望用户从列表中选择多个项目。我用下面的代码试了一下,
<ListBox x:Name="List" SelectionMode="Multiple" HorizontalAlignment="Left" Height="559" Margin="14,1,-1,0" VerticalAlignment="Top" Width="443" SelectionChanged="List_SelectionChanged_1">
<ListBox.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Vertical" Width="420" Height="60">
<TextBlock x:Name="tbName" Width="318" Foreground="{Binding color}" Height="35" FontSize="22" Text="{Binding Name}" Margin="-350,13,69,12" />
<Canvas x:Name="ContentPanelCanvas" Grid.Row="1" Background="Transparent" Margin="0,0,12,0">
<Line X1="0" Y1="00" X2="420" Y2="0" Stroke="Gray" StrokeThickness="0.3"/>
</Canvas>
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
但我仍然没有选择多个项目的复选框。 有什么问题?
【问题讨论】:
标签: c# xaml windows-phone-8