繁体   English   中英

在wp8中多次选择列表框时出现问题

[英]Trouble with multiple selection of a list box in wp8

我正在使用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>

但我仍然没有选中多个项目的复选框。 问题是什么?

我认为如果你使用Windows Phone Toolkit中的 LongListMultiSelector会更好你可以在这里找到代码示例 另请看一下这个问题

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM