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); }
private static Layout CreateAuthorityContact(string authorityName, string authorityTel) { ContactInfoView contactInfo = new ContactInfoView(authorityTel, authorityName); return(contactInfo); }