xaml - Swipe-select on a GridView Item in MVVM -


i have gridview want able swipe-select items or click on them.

as wanted work mvvm click handled command on button root of item in gridview.

in following simplified example of this:

<gridview     itemssource="{binding source={staticresource groupeditemsviewsource}}"     isswipeenabled="true"     padding="116,0,40,46">     <gridview.itemspanel>         <itemspaneltemplate>             <virtualizingstackpanel orientation="horizontal"/>         </itemspaneltemplate>     </gridview.itemspanel>     <gridview.itemtemplate>         <datatemplate>             <button command="{binding clickedcommand}" />         </datatemplate>     </gridview.itemtemplate> </gridview> 

my problem swipe won't recognized long have button in itemtemplate. command on button seems receive gestures , doesn't allow swipe-select item. when i

doesn have same problem or idea how solve this?

thank you!

i'd avoid using buttons in gridviewitems since have conflicting input handling. put content there instead of in button. way i'd use handle itemclick events, datacontext event sender (probably gridviewitem) item view model , invoke command event handler. if dislike code behind - can "gridview itemclick command" favorite search engine , might find attached behavior allows bind commands event.


Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -