You can use the PointerPressed / PointerReleased events in the GridViewItem to get the same effect you could get in RightTapped or ManipulationCompleted.
<ListView Margin="120,80,0,0" SelectionMode="Multiple"> <ListView.ItemContainerStyle> <Style TargetType="ListViewItem"> <Setter Property="Width" Value="100" /> <Setter Property="Height" Value="100" /> </Style> </ListView.ItemContainerStyle> <ListViewItem RightTapped="ListViewItem_RightTapped_1" PointerPressed="ListViewItem_PointerPressed_1" PointerReleased="ListViewItem_PointerReleased_1" ManipulationStarted="ListViewItem_ManipulationStarted_1"> <Rectangle Height="80" Width="80" Fill="Red" /> </ListViewItem> </ListView>
.
private void ListViewItem_RightTapped_1(object sender, RightTappedRoutedEventArgs e) { Debug.WriteLine("Tap"); } private void ListViewItem_PointerPressed_1(object sender, PointerEventArgs e) { Debug.WriteLine("Press"); } private void ListViewItem_ManipulationStarted_1(object sender, ManipulationStartedRoutedEventArgs e) { Debug.WriteLine("Manipulating"); } private void ListViewItem_PointerReleased_1(object sender, PointerEventArgs e) { Debug.WriteLine("Release"); } }
Output:
Press Release Press Release
* EDIT
Sorry, I must have missed something, that these events work differently with touch and mouse. I think the answers received may be the best you get. Otherwise, you will need to implement your own version of ListView. You can try to put pressure on them with the hope of a better solution in a future release, but I would not expect much. From what I remember, ContextMenus is not a great metro, and there are better UX solutions than right-click menus. You can display commands in the AppBar or on the details page that opens after selecting an item. This may work better than trying to crack a workaround for something that was never intended to be supported.
source share