【问题标题】:Trouble with multiple selection of a list box in wp8wp8中的列表框多选问题
【发布时间】: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


    【解决方案1】:

    我认为如果您使用来自Windows Phone ToolkitLongListMultiSelector 会更好 你可以找到代码示例here. 也可以看看this question

    【讨论】:

      猜你喜欢
      • 2015-08-02
      • 1970-01-01
      • 2012-06-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-08-09
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多