I have created a simple ListView with a context menu:
<ListView x:Name="listview" SelectionMode="Single">
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<StackLayout Orientation="Horizontal" >
<Label Text="{Binding item1}"></Label>
<Label Text="{Binding item2}"></Label>
<Label Text="{Binding item3}"></Label>
</StackLayout>
<ViewCell.ContextActions>
<MenuItem Text="Add" ></MenuItem>
<MenuItem Text="Delete"></MenuItem>
<MenuItem Text="Edit"></MenuItem>
</ViewCell.ContextActions>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
Development environment is Visual Studio 16.9.1, Xamarin Forms Nuget package is at 5.0.0.2012 which I believe are the latest. Pictures below are of the Android Pixel2 Emulator.
Selecting an item works ok:
A long press on the selected rows activates the menu but disables the selection background. Which row is the operation on?:
If I tap around randomly on other rows they may select or may deselect:
When I click the back button to exit the context menu the selections change again (notice the selections are different than the above image):
If I tap on each item they will deselect and return to a single selection.
I have SelectionMode="Single" and still seem to get multiple selections. What am I doing wrong?