Trouble binding LongListSelector.SelectedItem to MVVM property

前端 未结 2 919
遥遥无期
遥遥无期 2021-01-28 23:57

Using Visual Studio 2013 and the Window Phone 8 SDK I cannot get the SelectedItem property of the LongListSelector to properly bind to an MVVM property

2条回答
  •  梦毁少年i
    2021-01-29 00:34

    To get the item that was selected to the ViewModel, I'm always using a LongListSelector Extension - the code can be found here: https://gist.github.com/Depechie/7524630

    What you need to do is add it to the XAML of your LongListSelector:

    
    

    The command on the viewmodel will receive the object type of your item source on the LongListSelector

提交回复
热议问题