Search code examples
androidxamarinmvvmcrossmvxlistview

How do I get the selected item in MvxLIstView


I have added Item Click in MvxBind property.But I am unable to send the selected item along with its position.Help me with this.

Here i need Item.position or item to be sent.

 public ICommand ListItemSelected
 {

      get{

          return new MvxCommand<Person>(item =>{
                    _navigationService.Navigate<ThirdViewModel>(item);
          });
      }
 }

I am not able to send item here.I have added that item in ThirdViewModel constructor.


Solution

  • I found the mistake.

    public IMvxCommand listItemSelected
            {
                get
                {
                   return new MvxCommand<Person>((item) =>
                    {
                        _navigationService.Navigate(new ThirdViewModel(item));
                    });
                }
            }