Skip to content

Instantly share code, notes, and snippets.

@icebeam7
Created October 15, 2018 13:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save icebeam7/54b3e4e7ebef9feeb6d5b3e4f4e5c609 to your computer and use it in GitHub Desktop.
Save icebeam7/54b3e4e7ebef9feeb6d5b3e4f4e5c609 to your computer and use it in GitHub Desktop.
XamarinWhatsApp: PaginaMensaje.xaml.cs
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Twilio.Rest.Api.V2010.Account;
using Xamarin.Forms;
using Xamarin.Forms.Xaml;
using XamarinWhatsApp.Helpers;
using XamarinWhatsApp.Modelos;
using XamarinWhatsApp.Servicios;
namespace XamarinWhatsApp.Paginas
{
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class PaginaMensaje : ContentPage
{
ObservableCollection<MessageResource> ListaMensajes = new ObservableCollection<MessageResource>();
public PaginaMensaje ()
{
InitializeComponent ();
lsvMensajes.ItemsSource = ListaMensajes;
txtFrom.Text = Constantes.NumeroTwilioWhatsApp;
txtTo.Text = Constantes.NumeroUsuarioWhatsApp;
}
private void btnEnviar_Clicked(object sender, EventArgs e)
{
var mensaje = new Mensaje()
{
From = txtFrom.Text,
To = txtTo.Text,
Body = txtBody.Text
};
var whatsapp = ServicioWhatsAppTwilio.EnviarMensaje(mensaje);
ListaMensajes.Add(whatsapp);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment