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

Both binding source on Listview

$
0
0

I have this listview, but for the MenuItem I pass a comand ToRemovePersonand ( in my VM ) but there isn't binding because there is into the listview.
how I can specify the source of the command.

<ListView ItemsSource="{Binding DatasModels}" x:Name="listViewDatas"
                          IsPullToRefreshEnabled="true"
                      RefreshCommand="{Binding RefreshCommand}"
                        IsRefreshing="{Binding IsRefreshing}">
                <ListView.ItemTemplate>
                    <DataTemplate>
                        <ViewCell>
                            <ViewCell.ContextActions>
                                <MenuItem  Command="{Binding ToRemovePerson}" CommandParameter="{Binding .}"
                                Text="Delete" IsDestructive="True"/>
                            </ViewCell.ContextActions>

                            <StackLayout Orientation="Horizontal">
                                <Label Text="{Binding Firstname}"/>
                                <Label Text="{Binding Lastname}"/>
                                <Label Text="{Binding Company}"/>
                            </StackLayout>
                        </ViewCell>
                    </DataTemplate>
                </ListView.ItemTemplate>
                <ListView.Behaviors>
                    <behaviors:ListViewBehavior Command="{Binding SelectedItemList}" Converter="{StaticResource SelectedItemConverter}" />
                </ListView.Behaviors>
            </ListView>

Viewing all articles
Browse latest Browse all 204402

Trending Articles



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