is there an easyish way in Xamarin Forms to implement a "Swipe Right" event on an item, preferably a row in a grid.
I'm thinking about the way that you delete messages in the GMail app, which also nicely shows the row starting to move before you finish the swipe, so that you can tell that something is about to happen.
If this is in the category of things that is difficult enough that it is better to find a different solution then that would still be useful to know.
Thanks
Cedd
Refer https://github.com/pateljay0323/XamarinFormsGestures
for different gestures like SingleTap, DoubleTap, LongPress, Swipe, Pinch, Move, Up, Down, Unknown
Related
I have a NSSplitViewController and in one of the items I have multiple buttons with keyboard shortcuts.
Once the user hides the item, the shortcuts don't fire.
Is there any way to keep the buttons in the hidden view as part of the responder chain?
Sounds like the simple answer is no, according to Apple's docs. A simple workaround, however, might be to move the buttons out of the visible area by, say, shifting their bounds right by 10,000 or so. If they are in a scrollview/clipview that would expand to show the items in their new position, then this would not work so well, but if they aren't, it ought to work fine. If they are in a scrollview, then you might find a way to make them completely transparent, to achieve a similar effect.
That said, perhaps it is worth considering whether you have the right design in the first place, since having buttons that are not visible respond to key events is a questionable design from a user-interface perspective (as reflected by the fact that Apple tries to prevent it). Maybe those keyboard events should really be getting handled by a view higher in the view hierarchy, or by the window, or some such entity?
I'm looking for some animations for my listbox. When i swipe right on a listbox item, it goes to the bottom of the listbox and ideally, all the other listitems should gracefully go up. Similarly when I swipe left, that item gets deleted, and as before, the items needs to reposition.
I have implemented the functionality on swipe right and swipe left. But it is not graceful due to the lack of animations. How do I create those? Could someone share some blogs or msdn articles on how to create them. Or just give me some intro on this. I have never done animations before.
Thank you,
The Windows Phone Toolkit has some transition effects that could help you. I assume you already know it since you implemented the swipe functionality unless you didn't use the provided gestures from it??
I saw here and in some articles that I should use GestureListener to get Tap from user then use SelectionChanged. I tried it and I like it. But I have problem with it. When my listbox moves (scrolls) and I try tap I get bad item (I get item from last tap). When I scroll and wait for stopping scroll and then tap everything is fine (I get exactly item which I tap on). Anyone else with this problem? Any solution? Thanks
As (according to your tags) you're targetting 7.1, there is no need to have to use a GestureListener to detect Tap events.
All UIElements in Silverlight 4 (which 7.1 is based on) support a built in Tap event. See http://msdn.microsoft.com/en-us/library/system.windows.uielement.tap(v=vs.95).aspx
Using a GestureListener has an unnecessary performance overhead and can cause other issues as you're discovering.
You should use a Tap event in the individual ListBoxItems or the SelectionChanged event on the ListBox not both.
If you create a new Databound Application, the code in the default project files will show an example of how to use SelectionChanged and in that instance trigger a page navigation.
In future, you may also get a better, faster answer by showing the code you are having problems with, not just describing it.
I'm working on a app in which I used a listbox inside a pivot control just like the outlook app does. The problem is sometimes when I scroll the list, a swipe gesture is triggered and it goes to another pivot item. This is very annoying, and it seems doesn't happen to the outlook app. Am I doing something wrong? How do I fix it? Thanks a lot.
If you're just using the default controls in the default way then you're not doing anything wrong in your code.
You haven't said if you're getting this on the emualtor or on an actual device. I find I sometimes do this on the emulator if holding the mouse at a slight angle or on an actual device if holding that in a funny way (such as when lying down).
Whether you scroll the listbox or the pivot will depend on whether your finger (or mouse-if using the emulator on a non touch-screen PC) first moves vertically or horizontally after first touching the screen. In my experience the scenarios described above can lead to this not always working as expected but I've never seen an issue with this on a real device being held in one hand and scrolled using a thumb.
I am trying to give a ListBox drag and drop ordering functionality and I have hit a wall. I got it to work when I specify the list box items in xaml but it does not work when I bind to a list it no longer works because the items are no longer of a listboxitem type.
I found this code http://blog.dobaginski.com/josh/?p=52 that allows me to get the underlying ListBoxItem but I can't get the mouse move event to fire.
I have went through other tutorials but have not been able to find one that deals with a ListBox. Has anyone done this with a ListBox.
The events I am using are SelectedChange, MouseMove, and LeftMouseButtonUp (I think that name is right). I am not using LeftMouseButtonDown because I couldn't get it to fire.
As far as i know you cannot get at the listbox item container when using data binding. YOu could in Beta 1.
You also cannot set a mouse event handler in the style, you must use a data template, just so you know.
You will likely have to use the mouse move event from a parent element, probably the UserControl or main layout control that hosts the listbox.
State changes and animations need to be in the style though so... you still cant get at the listbox item, just the element inside it in the data template.
Oh and if doing drag and drop HitTest is now protected so that will make the Drop harder.
since today you can download the final 2.0 version of Silverlight with some add ons, check the Scott's web log
I've been trying to do the same thing in WPF,
but have only found many buggy implementations.
One person has guided me towards the blog of Beatriz Costa,
and from what I remember she's one of those rare geniouses,
so I suggest you read that as well... I know I will
Blog of Beatriz Costa