Exemplo n.º 1
0
        public ContactDetail(int userId, DetailsService _ds)
        {
            _contacts = _ds;

            if (userId <= _contacts.GetAllContacts().Last().Id)
            {
                temp           = _contacts.GetContactDetails(userId);
                BindingContext = new Contact
                {
                    Id        = temp.Id,
                    FirstName = temp.firstName,
                    LastName  = temp.lastName,
                    Phone     = temp.Phone,
                    Email     = temp.Email,
                    Blocked   = temp.Blocked
                };
            }
            intialId = userId;

            InitializeComponent();
        }
Exemplo n.º 2
0
        async void Delete_Clicked(object sender, System.EventArgs e)
        {
            var contact = (sender as MenuItem).CommandParameter as Contact;

            var response = await DisplayAlert("Confirm", "Are you sure you want to delete " + _service.GetContactDetails(contact.Id).FullName + "?", "Confirm", "Cancel");

            if (response)
            {
                _service.RemoveContact(contact);
            }
        }