コード例 #1
0
 public ContactViewModel(Contact contact)
 {
     Contact = contact;
     Number = contact.Number;
     Name = contact.Name;
     PhotoId = contact.PhotoId;
     Email = contact.Email;
 }
コード例 #2
0
 public void Send(Contact contact)
 {
     //if (!string.IsNullOrEmpty(contact.Email))
     //{
     //    var email = new Intent(Intent.ActionSend);
     //    email.PutExtra(Intent.ExtraEmail, new[] { contact.Email });
     //    email.PutExtra(Intent.ExtraSubject, "Hey, join me in AgendaOnline!");
     //    email.PutExtra(Intent.ExtraText, "Check this out: https://github.com/EgorBo/AgendaOnline-Xamarin.Forms");
     //    email.SetType("message/rfc822");
     //    Forms.Context.StartActivity(email);
     //}
     SmsManager.Default.SendTextMessage(contact.Number, null, "Check this out: https://github.com/EgorBo/AgendaOnline-Xamarin.Forms", null, null);
 }
コード例 #3
0
        public void Send(Contact contact)
        {
            if (!string.IsNullOrEmpty(contact.Email))
            {
                var emailComposeTask = new EmailComposeTask();

                emailComposeTask.Subject = "Hey, join me in AgendaOnline!";
                emailComposeTask.Body = "Check this out: https://github.com/EgorBo/AgendaOnline-Xamarin.Forms";
                emailComposeTask.To = contact.Email;

                emailComposeTask.Show();
            }
            else
            {
                var emailComposeTask = new SmsComposeTask();

                emailComposeTask.Body = "Check this out: https://github.com/EgorBo/AgendaOnline-Xamarin.Forms";
                emailComposeTask.To = contact.Number;

                emailComposeTask.Show();
            }
        }
コード例 #4
0
 public void Send(Contact contact)
 {
     var smsTo = NSUrl.FromString("sms:" + contact.Number);
     UIApplication.SharedApplication.OpenUrl(smsTo);
 }