3

In a WP8 app, I have a ListBox bound to an ItemsSource with a Grid as it's ItemsPanelTemplate. The layout of the Grid might be different each time (different number of rows/columns) based on user selection and I'm using a helper class in order to bind the ItemsPanelTemplate Grid's Row and Column Definitions to values read from a database.

The user can add item's to the app and assign each item to a Grid cell in the ListBox. Each item can "sit" in multiple Grids (a many-to-many relationship), which led me to use another binding helper class in order to set the bindings of Grid.Row and Grid.Column attached properties in the ListBox.ItemContainerStyle, bound to a property of the ItemsSource class.

Another requirement is to have the app in Portrait orientation when Rows.Count >= Columns.Count and in Landscape when the columns are more.

I'm also using the Toolkit Gestures for drag and drop operations.

The issue in question, is a drag issue on Landscape orientation. While everything works great on Portrait, while on Landscape orientation the ListBox goes crazy. The dragging happens to different cell's that those actually being dragged and some of them don't even raise the gesture events (DragStarted, DragDelta, DragCompleted).

I'm lost here, don't know what the issue might be, or how to solve this.

Need your lights please.

Here is a sample that illustrates the problem.

EDIT

Phew, it's a bug of the GestureListener on the toolkit. It does not respect the Landscape orientation and treats the UIElements as if they were rendered in Portrait.

Using the Manipulation Events instead, which work properly. Can I have my 50 bounty points back? :P

Pantelis
  • 2,020
  • 3
  • 23
  • 39

1 Answers1

2

If it is not gesture listener but Manipulation Event you are looking at there is couple of good questions out there:

Drag and drop from list to canvas on windows phone with MVVM

Moving Object in ScrollViewer

Community
  • 1
  • 1
JTIM
  • 2,555
  • 28
  • 65
  • Thanks, although this has nothing to do with my question. I know how to drag and drop, the issue was the deprecated gesturelistener as I'm mentioning in my edit. – Pantelis May 11 '14 at 17:07