private void ListView_SwipeEnded(object sender, SwipeEndedEventArgs e)
{
swipedItem = e.ItemData;
swipeOffset = listView.SwipeOffset;
if (e.SwipeDirection.ToString() == "Left")
swipeOffset = swipeOffset * (-1);
} |
private void ListView_SwipeReset(object sender, ResetSwipeEventArgs e)
{
if (canReset)
swipedItem = null;
} |
private void Add_Clicked(object sender, EventArgs e)
{
canReset = false;
var contacts = new Contacts();
contacts.ContactName = "DataBase";
contacts.ContactNumber = "192-10000";
(listView.ItemsSource as IList).Insert(1, contacts);
if (swipedItem != null)
listView.SwipeItem(swipedItem, swipeOffset);
canReset = true;
} |