Forum Xamarin.iOS

After using contextActions on the viewcell of a listview does not fire tapped afterwards on IOS only

devxusdevxus Member ✭✭

This is an IOS only issue.

I have a listview as below(refer code removed extra code to show the structure).

When I use the context menu actions ex:add to contacts/favourites for an entry then my code adds the contact to the favorites etc in the code .In the screen nothing changes after the add to favorites is pressed.

But once this event is executed then the tapped event of the entry i just made favorite stops working.
If i refresh the screen and reload some other list in the same list view still the entry ex:if the position of the entry was 3 then 3 tapped event and everything following it does not work)

I am not sure why it does not hit the breakpoint for the tapped event handler once the context menu action is used.

Anything simple I am missing?

<ListView VerticalOptions="FillAndExpand"  x:Name="ControlDirectorylistview"  HorizontalOptions="FillAndExpand" HasUnevenRows="True"  IsPullToRefreshEnabled="True" Margin="0"   Refreshing="Directorylistview_Refreshing">
                <ListView.ItemTemplate>
                    <DataTemplate>
                        <ViewCell x:Name="ListViewCell"** Tapped="ListViewCell_Tapped"** BindingContextChanged="OnBindingContextChanged">

                            <ViewCell.ContextActions>
                                <MenuItem x:Name="AddtoFavoriteMenuitem" Clicked="AddtoFavoriteMenuitem_Clicked"  Icon="staradd.png"  Text="Add Favorite"/>                               
                           </ViewCell.ContextActions>

                            <StackLayout HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand"  Orientation="Horizontal" Padding="0,5,0,5">
                                <Grid  HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand">
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="Auto"/>
                                    </Grid.RowDefinitions>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="Auto"/>
                                        <ColumnDefinition Width="*"/>
                                    </Grid.ColumnDefinitions>
                                    <Grid HorizontalOptions="FillAndExpand"  Grid.Column="0" Grid.Row="0"  VerticalOptions="FillAndExpand">
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition Width="10"/>
                                            <ColumnDefinition Width="70"/>
                                        </Grid.ColumnDefinitions>

                                    </Grid>
                                    <Grid Grid.Column="1" Grid.Row="0"  VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand">
                                        <Grid.RowDefinitions>
                                            <RowDefinition Height="Auto"/>
                                            <RowDefinition Height="Auto"/>
                                        </Grid.RowDefinitions>

                                    </Grid>
                                </Grid>
                            </StackLayout>
                        </ViewCell>
                    </DataTemplate>
                </ListView.ItemTemplate>
            </ListView>
Sign In or Register to comment.