How to use SelectionChangedCommand

DarkoshacyDarkoshacy Member ✭✭
edited June 26 in Xamarin.Forms

I trying to get data from CollectionView to ViewModel when activeItem has changed.
I try to bind ICommand on SelectionChangedCommand="{Binding Swipe}" but on swipe I don't get data from CollectionView. Command "Swipe" is not triggered. I am doing something wrong, but can't find appropriate sample on documentation.
So my question is: How to use SelectionChangedCommand ? Or How to track active item from CollectionView in my ViewModel .
My code is on github: https://github.com/Darkoshacy/CollectionViewMySample

Best Answers

Answers

  • DarkoshacyDarkoshacy Member ✭✭

    I have tried SelectedItem="{Binding ActiveUser,Mode=TwoWay}"
    not working.
    I have put breakpoint inside set{...} but nothing happends when I swipe item (tried to tap to select). Is there another way to check is Item Selected?

  • LucasZhangLucasZhang Member, Xamarin Team Xamurai
    edited June 26

    What is version of xamarin.forms? SelectedItem works fine on my side , you can firstly update the version of xamarin.forms .

  • DarkoshacyDarkoshacy Member ✭✭

    @LucasZhang said:
    What is version of xamarin.forms? SelectedItem works fine on my side , you can firstly update the version of xamarin.forms .

    Xamarin.Forms 4.0.0.497661 (latest)
    VS Community 2019 16.1.4 (latest)

  • DarkoshacyDarkoshacy Member ✭✭

    @LucasZhang said:
    Your code works fine on my side . And you can download it and have a test .

    My Solution must have some bug!?!
    Your solution works fine.
    Thanx for help.

Sign In or Register to comment.