Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

Using IsDescructive in ContextAction produces non clickable items on iOS

$
0
0

Hello,
I have a listview with uneven rows. The items have a typical context action "delete" with the attribute "IsDescructive="true". Now, when I swipe on an item to open the context menu and then cancel the action, the item is not clickable anymore until the listview is realoaded completely.

This is XAML code of my listview:

<ListView x:Name="listView" Margin="0,0,0,0" HasUnevenRows="True" SelectionMode="None" ItemTapped="ListView_ItemTapped" ItemAppearing="ListView_ItemAppearing" BackgroundColor="{StaticResource StandardBackgroundColor}">
    <ListView.ItemTemplate>
        <DataTemplate>
            <ViewCell>
                <ViewCell.ContextActions>
                    <MenuItem Clicked="OnDelete" CommandParameter="{Binding .}" Text="Löschen"  />
                </ViewCell.ContextActions>
                <StackLayout Orientation="Vertical" HeightRequest="90" HorizontalOptions="Fill">
                    <StackLayout Orientation="Horizontal" Margin="10,10,10,0" HorizontalOptions="Fill">
                        <Label Text="{Binding Discipline}" VerticalOptions="Center" HorizontalOptions="StartAndExpand" FontSize="Small" FontAttributes="Bold" TextColor="Black" MaxLines="1"/>
                        <Label Text="{Binding Startdate}" VerticalOptions="Center" HorizontalOptions="End" FontSize="Small" MinimumWidthRequest="100" HorizontalTextAlignment="End" MaxLines="1"/>
                    </StackLayout>
                    <StackLayout Orientation="Horizontal" Margin="10,0,10,0" HorizontalOptions="Fill" >
                        <Label Text="{Binding FinalResult}" VerticalOptions="Center" HorizontalOptions="Start" WidthRequest="50" MinimumWidthRequest="50" FontSize="Medium" TextColor="{StaticResource ColorPrimary}" FontAttributes="Bold"/>
                        <Label Text="{Binding PartResults}" VerticalOptions="Center" HorizontalOptions="StartAndExpand" FontSize="Small"/>
                    </StackLayout>
                    <StackLayout Orientation="Horizontal" Margin="10,0,10,10" HorizontalOptions="Fill">
                        <Label Text="{Binding ActivityType}" VerticalOptions="Center" HorizontalOptions="Start" FontSize="Small" TextColor="Gray" FontAttributes="Bold"/>
                    </StackLayout>
                </StackLayout>
            </ViewCell>
        </DataTemplate>
    </ListView.ItemTemplate>
</ListView>

In the ItemAppearing event I load the model from the database to set the labels via the viewmodel.
The listview ItemSource is set in the constructor of the page and the type is ObservableCollection. So not something special.

As soon as I remove the IsDestructive attribute from the MenuItem, everything works well.

Does someone also have the problem?


Viewing all articles
Browse latest Browse all 204402

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>