Created
October 15, 2018 13:04
-
-
Save icebeam7/54b3e4e7ebef9feeb6d5b3e4f4e5c609 to your computer and use it in GitHub Desktop.
XamarinWhatsApp: PaginaMensaje.xaml.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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