I have a Listbox. Each item has Context menu.IfI simply hold on item and do work with it, it not selected and I get error.If I for the first select item and than do work, all is ok.How I can select item on hold gesture?
<DataTemplate>
<Grid Margin="0,5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<toolkit:ContextMenuService.ContextMenu>
<toolkit:ContextMenu IsEnabled="{Binding uid, Converter={StaticResource CanDelete}}" IsZoomEnabled="True" x:Name="databoundMenu">
<toolkit:MenuItem Header="Удалить" Click="deleteComment"/>
</toolkit:ContextMenu>
</toolkit:ContextMenuService.ContextMenu>
.....
</Grid>
</DataTemplate>
c#
var it = this.comm_box.SelectedItem as Comments;