Beispiel #1
0
 private void SwipeListViewItem_ItemSwipe(object sender, ItemSwipeEventArgs e)
 {
     if (e.Direction == SwipeListDirection.Right)
     {
         Context.MessageReplyCommand.Execute(ViewModel);
     }
 }
Beispiel #2
0
        private void HistoryTimelineHeader_ItemSwipe(object sender, ItemSwipeEventArgs e)
        {
            if (e.Direction == SwipeListDirection.Right)
            {
                // update state
                state++;
                if (state == 3)
                {
                    HistoryTimelineHeader.RightOrButtomBehavior = SwipeListBehavior.Disabled;
                }
                else
                {
                    HistoryTimelineHeader.RightOrButtomBehavior = SwipeListBehavior.Expand;
                }


                if (historyGrid == null)
                {
                    // create time grid
                    historyGrid = new TimeGrid();

                    // set as content
                    HistoryTimelineContent.Children.Clear();
                    HistoryTimelineContent.Children.Add(historyGrid);
                    historyGrid.HorizontalAlignment = HorizontalAlignment.Stretch;
                    historyGrid.VerticalAlignment   = VerticalAlignment.Stretch;
                }

                // setup content
                SetupHistoryGrid(state);
                SetupHistoryBarContent(state);
            }
            else
            {
                // update state
                state--;
                if (state == 0)
                {
                    HistoryTimelineHeader.LeftOrTopBehavior = SwipeListBehavior.Disabled;
                }
                else
                {
                    HistoryTimelineHeader.RightOrButtomBehavior = SwipeListBehavior.Expand;
                }

                // setup content
                SetupHistoryGrid(state);
                SetupHistoryBarContent(state);
            }

            HistoryTimelineHeader.ResetSwipe();
        }
        private void SwipeListView_ItemSwipe(object sender, ItemSwipeEventArgs e)
        {
            var item = e.SwipedItem as EmailObject;

            if (item != null)
            {
                if (e.Direction == SwipeListDirection.Left)
                {
                    item.Unread = !item.Unread;
                }
                else
                {
                    (Resources["Emails"] as EmailCollection).Remove(item);
                }
            }
        }
Beispiel #4
0
        private async void ItemSwipeCommandExecute(ItemSwipeEventArgs e)
        {
            var item = e.SwipedItem as MessageList;

            if (item != null)
            {
                if (e.Direction == SwipeListDirection.Left)
                {
                    await HttpRequest.PostRequestFormData(SaveMessageUrl, HostMessage, Origin, GeneratePostDataMessageId(item.id));

                    MessageList.Remove(item);
                }
                else
                {
                    await HttpRequest.PostRequestFormData(DeleteMessage, HostMessage, Origin, GeneratePostDataMessageId(item.id));

                    HtmlMessageContent = string.Empty;
                    MessageList.Remove(item);
                }
            }
        }