C# 带有上下文菜单的LongListSelector
实际上,我正在尝试在我的WindowsPhone8应用程序的LongListSelector中实现一个ContextMenu。 这就是我正在做的。我不明白为什么上下文菜单没有显示出来。我如何使它工作/C# 带有上下文菜单的LongListSelector,c#,windows-phone-8,windows-phone,contextmenu,longlistselector,C#,Windows Phone 8,Windows Phone,Contextmenu,Longlistselector,实际上,我正在尝试在我的WindowsPhone8应用程序的LongListSelector中实现一个ContextMenu。 这就是我正在做的。我不明白为什么上下文菜单没有显示出来。我如何使它工作/ <phone:LongListSelector Name="Storico" HorizontalAlignment="Left" Height="384" Margin="39,254,0,0" VerticalAlignment="Top" Width="406" BorderBrush
<phone:LongListSelector Name="Storico" HorizontalAlignment="Left" Height="384" Margin="39,254,0,0" VerticalAlignment="Top" Width="406" BorderBrush="#FFFF2800" Tap="Storico_Tap">
<phone:LongListSelector.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding Name}" Width="420" Height="40" Foreground="#FFFF9000" FontSize="30" ManipulationStarted="TextBlock_ManipulationStarted" ManipulationCompleted="TextBlock_ManipulationCompleted"/>
<toolkit:ContextMenuService.ContextMenu>
<toolkit:ContextMenu Name="ContextMenu" >
<toolkit:MenuItem Name="Watch" Header="Watch Trailer"/>
<toolkit:MenuItem Name="Buy" Header="Buy"/>
<toolkit:MenuItem Name="Share" Header="Share"/>
</toolkit:ContextMenu>
</toolkit:ContextMenuService.ContextMenu>
</DataTemplate>
</phone:LongListSelector.ItemTemplate>
</phone:LongListSelector>
提前感谢是否尝试将ContextMenu添加到TextBlock
<TextBlock Text="{Binding Name}" Width="420" Height="40" Foreground="#FFFF9000" FontSize="30" ManipulationStarted="TextBlock_ManipulationStarted" ManipulationCompleted="TextBlock_ManipulationCompleted">
<toolkit:ContextMenuService.ContextMenu>
<toolkit:ContextMenu Name="ContextMenu" >
<toolkit:MenuItem Name="Watch" Header="Watch Trailer"/>
<toolkit:MenuItem Name="Buy" Header="Buy"/>
<toolkit:MenuItem Name="Share" Header="Share"/>
</toolkit:ContextMenu>
</toolkit:ContextMenuService.ContextMenu>
</TextBlock>
谢谢你,伙计!虽然你的解决方案看起来很“简单”,但这才是真正有效的。我已经试过了,我不知道为什么它以前不起作用。再次感谢!:)