示例#1
0
        public Layout CreateContactInfoOnPick()
        {
            StackLayout result = new StackLayout();

            if (SelectedIndex == -1)
            {
                SelectedName = "";
                return(result);
            }

            SelectedName = Items[SelectedIndex];
            Operator selected = Operators.Where(entity => string.Equals(entity.Name, SelectedName)).First();

            Label  operatorName     = CreateOperatorNameLabel(selected.Name);
            Layout operatorContact  = new ContactInfoView(selected.Phone);
            Layout authorityContact = CreateAuthorityContact(selected.Authority, selected.Tel);

            result.Children.Add(operatorName);
            result.Children.Add(operatorContact);
            if (authorityContact != null)
            {
                result.Children.Add(authorityContact);
            }
            return(result);
        }
示例#2
0
        private static Layout CreateAuthorityContact(string authorityName, string authorityTel)
        {
            ContactInfoView contactInfo = new ContactInfoView(authorityTel, authorityName);

            return(contactInfo);
        }