Disclaimer: this is written for the Windows 8 Developer Preview

That’s a new property on the ListViewBase in Metro Style Windows 8 apps. ListView and GridView inherit from this base.

I think it’s a GREAT feature.. it allows the user to drag around items in the gridview or listview and animates this nicely:

image_21

But, there are some things you need to know to get it to work. First of all theAllowDrop property also needs to be set to true.

And the grid or list needs to be binded to a ObservableVector (no ObservableCollection is not good enough). But in the developer preview only an interface exists for this collection, so you have to make your own implementation or borrow one.. like this one.

One caveat remains.. the ObservableVector needs to be initialized with object as T, strong types will not work in the developer preview of windows 8. Like so:

image_22

 

 

Hope this helps.

Flores Eken

Author Flores Eken

I’m passionate about technology in general and particularly about software development and automation. Specializing in Infrastructure automation and Microsoft .NET, I can handle the entire process, from installing a Team Foundation Server to the smallest programming detail. Always innovating and on the cutting edge.

More posts by Flores Eken
20 February 2012

Leave a Reply