Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Selected Items using MVVM in WinRT

I'm struggling to find a way to bind the SelectedItems property in a ListView to the view model.

Previously I used this: http://www.codeproject.com/Articles/412417/Managing-Multiple-selection-in-View-Model-NET-Metr which no longer works in the RTM release.

Any help is much appreciated!

Thanks in advance :)

like image 608
Jamie Avatar asked Sep 19 '12 12:09

Jamie


2 Answers

You could look at the ListViewExtensions.BindableSelection from the WinRT XAML Toolkit on CodePlex.

like image 90
mschoneman Avatar answered Nov 15 '22 01:11

mschoneman


Turns out binding to the attached property was failing because the type of the attached property was being seen as

From the output window in Visual Studio:

type ('null')

After further research it became apparent that any generic class would fail to bind with this exact error. As a quick fix I simply changed the type to "object".

like image 23
Jamie Avatar answered Nov 15 '22 00:11

Jamie