Windows phone 7 上下文菜单中特定项的选定索引

Windows phone 7 上下文菜单中特定项的选定索引,windows-phone-7,Windows Phone 7,那么请告诉我如何获得上下文菜单的选定索引??? 我在xaml中的代码是: i have a listbox that shows schedule name,date,time and when i long press the particular item of listbox then it opens a context menu in which i have two items that is add to calendar and view description,so i wa

那么请告诉我如何获得上下文菜单的选定索引??? 我在xaml中的代码是:

 i have a listbox that shows schedule name,date,time and when i long press the particular item of listbox then it opens a context menu in which i have two items that is add to calendar and view description,so i want that wen i click view description then it will open a popup and display the description of the selected item in a list box.


因此,请告诉我如何在上下文菜单中获取所选索引,我单击某个特定项上的“查看说明”,然后它会打开一个弹出窗口,并且该特定项的计划名称和描述在上下文菜单项的单击处理程序中可见,您可以使用它来获取单击的项: (用列表项类名替换ScheduleItem)

 <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
            <ListBox x:Name="scheduleListbox" ItemsSource="{Binding scheduleList}" Tap="scheduleListbox_Tap" >
                <ListBox.ItemTemplate>
                    <DataTemplate>
                       <StackPanel Orientation="Vertical" Height="150" Width="460">
                            <toolkit:ContextMenuService.ContextMenu>
                                <toolkit:ContextMenu>
                                    <toolkit:MenuItem Header="Add To Calendar"/>
                                    <toolkit:MenuItem Header="View Description" Click="MenuItem_Click"/>
                                </toolkit:ContextMenu>
                            </toolkit:ContextMenuService.ContextMenu>
                            <TextBlock x:Name="textBlock1" Text="{Binding ScheduleName}" Foreground="WhiteSmoke" FontSize="32"/>
                            <TextBlock x:Name="textBlock2" Text="{Binding ScheduleDate}" Foreground="Red" Margin="0,10,0,0"/>
                            <StackPanel Orientation="Horizontal" Height="70" Width="460">
                                <TextBlock x:Name="textBlock3" Text="{Binding StartTime}" Margin="0,5,0,0"/>
                                <TextBlock x:Name="textBlock4" Text="{Binding EndTime}" Margin="50,5,0,0"/>
                            </StackPanel>
                        </StackPanel>

                    </DataTemplate>
                </ListBox.ItemTemplate>
            </ListBox>
        </Grid>
    </Grid>
ListBoxItem contextMenuListItem = (ListBoxItem)(scheduleListbox.ItemContainerGenerator.ContainerFromItem(((MenuItem)sender).DataContext));
ScheduleItem item = (ScheduleItem)contextMenuListItem.Content;