public void GetMessagesCallback(object response, bool IsException) { if (IsException) { App42Exception exception = (App42Exception)response; if (exception.GetAppErrorCode() == 2601) { lbxMessageMyProfileMessageTB.Text = "No Messages"; } else { lbxMessageMyProfileMessageTB.Text = "Error,Please try again later"; } } else { Storage storage = (Storage)response; _messagelist.Clear(); for (int i = 0; i < storage.GetJsonDocList().Count; i++) { MessageItem item = new MessageItem(); JObject messageObject = JObject.Parse(storage.GetJsonDocList()[i].GetJsonDoc()); item.Message = messageObject["Message"].ToString(); item.SenderName = messageObject["SenderName"].ToString(); item.Icon = messageObject["Picture"].ToString(); item.MessageId = storage.GetJsonDocList()[i].GetDocId(); _messagelist.Add(item); } lbxMessageMyProfile.ItemsSource = _messagelist; lbxMessageMyProfileMessagePopup.Visibility = Visibility.Collapsed; } }
private void btnDeleteMyProfile_Tap(object sender, GestureEventArgs e) { item = (MessageItem)((sender as FrameworkElement).Tag); App42Api.DeleteMessage(item.MessageId, DeleteMessageCallback); lbxMessageMyProfileMessageTB.Text = "Please wait..."; lbxMessageMyProfileMessagePopup.Visibility = Visibility.Visible; }