C# WP8上下文菜单显示在WrapPanel顶部

C# WP8上下文菜单显示在WrapPanel顶部,c#,windows-phone-8,C#,Windows Phone 8,我想在我的应用程序中有一个上下文菜单,当点击并按住WrapPanel项时显示,但上下文菜单显示在WrapPanel本身的顶部 <Grid x:Name="LayoutRoot" Background="Black"> <Grid.RowDefinitions> <RowDefinition Height="Auto"/> <RowDefinition Height="*"/> </Grid.Ro

我想在我的应用程序中有一个上下文菜单,当点击并按住WrapPanel项时显示,但上下文菜单显示在WrapPanel本身的顶部

<Grid x:Name="LayoutRoot" Background="Black">
    <Grid.RowDefinitions>
        <RowDefinition Height="Auto"/>
        <RowDefinition Height="*"/>
    </Grid.RowDefinitions>

    <!--TitlePanel contains the name of the application and page title-->
    <StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="12,17,0,28">
        <TextBlock x:Name="ApplicationTitle" Text="MY APPLICATION" Style="{StaticResource PhoneTextNormalStyle}"/>
        <TextBlock x:Name="PageTitle" Text="page name" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle1Style}"/>
    </StackPanel>

    <!--ContentPanel - place additional content here-->
    <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
        <toolkit:WrapPanel x:Name="wpPanel" Background="Black">
            <toolkit:ContextMenuService.ContextMenu>
                <toolkit:ContextMenu IsZoomEnabled="False" x:Name="cmMenu" >
                    <toolkit:MenuItem x:Name="remove" Header="remove" />
                </toolkit:ContextMenu>
            </toolkit:ContextMenuService.ContextMenu>
        </toolkit:WrapPanel>
    </Grid>
</Grid>
<> P>我如何让它出现在包装件的中间?


注:如果我删除了标题面板,ContextMenu显示在WrabaNEL项目的中间。

如果你想在中间设置的顶部边距这样打开:

   <toolkit:WrapPanel x:Name="wpPanel" Background="Green">
                    <toolkit:ContextMenuService.ContextMenu>
                        <toolkit:ContextMenu IsZoomEnabled="False" x:Name="cmMenu" Margin="0,50,0,0">
                            <toolkit:MenuItem x:Name="remove" Header="remove"/>
                        </toolkit:ContextMenu>
                    </toolkit:ContextMenuService.ContextMenu>
                </toolkit:WrapPanel>

对不起,我的意思是上下文菜单应该出现在Wrabanel项目的中间。对于包装面板项目中间的上下文菜单,根据您需要调整余量,可以设置VieldCalpal=中心,但这不是按您的要求工作。