GridView and Swipe Gesture on Item RRS feed

  • Question

  • Hi everyone,

    I'm quite fed up right now and I've come to a point where I'm not sure anymore if my idea might work at all.

    Project: I create a grading app (Win8 Store Deisgn, C#) where all students of a course are displayed within a GridView (see picture below). For grading their participation during class, I need a system which has to be fast and intuitive (I have to grade ~30 students per hour), but it has not to be very differentiating. Categorizing in "++", "+", "o", "-", "--" would be enough. 

    My idea: I would like to use a touch gesture on each Item (the picture of the student) doing the following: Swipe up means "increase grade by one" (initially starting wit "o" in every class) whereas Swipe down means "decrease grade by one".

    (I cannot post images right now, I will do that as soon as possible.)

    So the needs are: Use a GridView, whose ItemSource property is bound to an ObservableCollection where all students exist as objects (data coming from mysqlite, but that's not the problem here). 

    Problems are:

    How can I overlay the "Student" image with the (transparent) png with the button image (Using two images in a StackPanel and changing opacity seems not to work out - of course, in a stack panel, all elements are ordered beneath or below) and (far more serious)
    If I capture the swipe gesture (my current approach: 
    Set GridView.ManipulationMode to TranslateInertia
    Enqueue handlers for ManipulationStarted and MinpulationDelta and
    check, if Man.Delta.Y changes over certain limits.
    Problem with this approach: How do I determine the Item on which the gesture was fired?

    I hope that someone has the time to think about my approach and to help me with the stated problems.

    Thank you in advance

    Adrian Lehrmann
    Thursday, June 6, 2013 8:33 PM


  • Hi Adrian,

    I have responded to many posts where people are looking for custom gestures so I have uploaded one sample this time. You would like to refer my sample Developing a Custom Control using Gestures, it will give you a very good starting point.

    You really do not need a button and set of controls as you have mentioned. In my sample i have an image placed inside my custom control and you have swipe up and swipe down commands working on it.

    -- Vishal Kaushik --

    Please 'Mark as Answer' if my post answers your question and 'Vote as Helpful' if it helps you.

    Happy Coding!!!

    Saturday, June 8, 2013 6:53 AM