在语义缩放中删除多个项目(缩小视图)

时间:2013-06-06 16:01:34

标签: c# windows-runtime windows-store-apps semantic-zoom

我一直在开发一个包含语义缩放的应用程序(Windows8商店应用程序),我在gridview中绑定数据。缩小网格的绑定如下

 <GridView x:Name="zoomOutGrid" 
                                      VerticalAlignment="Top" Height="400" 
                                      ScrollViewer.VerticalScrollMode="Enabled"
                                      ScrollViewer.HorizontalScrollMode="Disabled"
                                      ScrollViewer.VerticalScrollBarVisibility="Auto"
                                      ScrollViewer.IsVerticalRailEnabled="False"
                                      ScrollViewer.ZoomMode="Disabled"
                                      ManipulationMode="None"
                                      IsSwipeEnabled="True"
                                      SelectionChanged="zoomOutGrid_SelectionChanged"
                                      SelectionMode="Multiple">
                                <GridView.ItemTemplate>
                                    <DataTemplate>
                                        <StackPanel>
                                            <Border >
                                                    <StackPanel Name="stkButtonContentWraper" Orientation="Horizontal">
                                                        <TextBox Name="txtObjectButtonStar" Text="*" Style="{StaticResource Star}"/>
                                                        <Rectangle Name="rectObjectButtonIcon" Fill="{Binding Group.ButtonIcon}" Style="{StaticResource ObjectButtonIcons}"/>
                                                        <StackPanel Orientation="Vertical" Margin="0,10,0,0">
                                                            <TextBlock x:Name="txtBtn"  Text="{Binding Group.Title}" Style="{StaticResource ObjectButtonName}" />
                                                            <TextBlock Name="txtObjectInfo" Text="{Binding Group.ObjectTextInfo}" Style="{StaticResource ObjectTextInformation }"/>
                                                        </StackPanel>
                                                    </StackPanel>
                                            </Border>
                                        </StackPanel>
                                    </DataTemplate>
                                </GridView.ItemTemplate>
                                <GridView.ItemContainerStyle>
                                    <Style TargetType="GridViewItem">
                                        <Setter Property="Margin" Value="0" />
                                        <Setter Property="Padding" Value="0" />
                                    </Style>
                                </GridView.ItemContainerStyle>
                                <GridView.ItemsPanel>
                                    <ItemsPanelTemplate>
                                        <WrapGrid ItemWidth="240" 
                                                  Margin="0,0,0,0"
                                                  Orientation="Horizontal" 
                                                  MaximumRowsOrColumns="2">
                                        </WrapGrid>
                                    </ItemsPanelTemplate>
                                </GridView.ItemsPanel>
                            </GridView>

当我选择多个项目(右键单击)/滑动选择时,它总是给我相同的选定索引(第一个选定项目的索引)。我想获取所有这些项目选择的索引/所选项目,以删除它们。

我无法弄清楚为什么它总是给我相同的索引。

谢谢,

0 个答案:

没有答案