sharingpax.blogg.se

Xojo click and hold on a listbox
Xojo click and hold on a listbox




I am an expert in Angular, JavaScript, NodeJS. Thanks for reading.įollow am a Microsoft MVP and Google GDE based out of Gurgaon, India. Avoid raising hold event on ListBox itself else you will get NullReference exception. In my case there is no container but an Image so I am raising Hold event on the Image control. For example, if you have a StackPanel inside DataTemplate then you need to raise the Hold event on StackPanel. In this way you can select a ListBox item on the hold event.īefore I conclude one point keep in mind that you need to raise Hold event on the container inside the ListBox. In above code you cans see that I am getting data context of selected image in instance of entity class photo. For that I have raised a hold event on the Image control in List Box and in the hold event need to fetch the selected image as data context. When user hold a particular image in ListBox that image should get selected. Now question comes that how to set a particular image from list of images in ListBox on the hold event. You see in the List Box, I have put an Image control and binding Source and Tag dependency property of the image to the data source.Īt the code behind, I got an entity class Photo as below,įinally, I am setting ItemsSource of ListBox as below. I was working on an application and I had to select a List Box Item on the hold event.






Xojo click and hold on a listbox