public ObservableCollection <ContactsInfo> GetContactDetails()
        {
            ObservableCollection <ContactsInfo> customerDetails = new ObservableCollection <ContactsInfo>();

            for (int i = 0; i < CustomerNames2.Count(); i++)
            {
                var details = new ContactsInfo()
                {
                    ContactName   = CustomerNames2[i],
                    ContactNumber = CustomerNames2[i].Replace(" ", "") + "@outlook.com",

                    ContactImage = "b" + (i % 14) + ".png",
                };
                customerDetails.Add(details);
                if (i < 23)
                {
                    details = new ContactsInfo()
                    {
                        ContactName   = CustomerNames1[i],
                        ContactNumber = CustomerNames1[i].Replace(" ", "") + "@outlook.com",

                        ContactImage = "a" + (i % 6) + ".png",
                    };
                    customerDetails.Add(details);
                }
            }
            return(customerDetails);
        }
Example #2
0
        public ObservableCollection <ContactsInfo> GetContactDetails(int count)
        {
            ObservableCollection <ContactsInfo> customerDetails = new ObservableCollection <ContactsInfo>();

            for (int i = 0; i < 10; i++)
            {
                var details = new ContactsInfo()
                {
                    ContactType   = ContactsInfo.ContactsType.Business,
                    ContactNumber = random.Next(100000, 400000).ToString(),
                    ContactName   = customerNames[i],
                };
                customerDetails.Add(details);
            }

            customerDetails[0].ContactImage = Resource.Drawable.Contact0;
            customerDetails[1].ContactImage = Resource.Drawable.Contact1;
            customerDetails[2].ContactImage = Resource.Drawable.Contact2;
            customerDetails[3].ContactImage = Resource.Drawable.Contact3;
            customerDetails[4].ContactImage = Resource.Drawable.Contact4;
            customerDetails[5].ContactImage = Resource.Drawable.Contact5;
            customerDetails[6].ContactImage = Resource.Drawable.Contact6;
            customerDetails[7].ContactImage = Resource.Drawable.Contact7;
            customerDetails[8].ContactImage = Resource.Drawable.Contact8;
            customerDetails[9].ContactImage = Resource.Drawable.Contact9;
            return(customerDetails);
        }
        /// <summary>
        /// Raised to add the item to list view through data form if the form is valid.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void OnAdd(object sender, EventArgs e)
        {
            contactLabel.Text        = "Add Contact";
            refreshButton.Visibility = ViewStates.Visible;
            dataFormView.Visibility  = ViewStates.Visible;

            // Setting data object for DataForm and update the read only property.
            var item = new ContactsInfo();

            if (item.ContactImage == 0)
            {
                item.ContactImage = Resource.Drawable.ContactName;
            }
            refreshLayout       = false;
            dataForm.DataObject = item;
            isReadOnly          = true;
            UpdateDataFormView(false);

            linearLayout.GetChildAt(0).Visibility = ViewStates.Gone;
            linearLayout.GetChildAt(1).Visibility = ViewStates.Gone;
        }