private void LoadRows(OSProfileViewController controller) { tableData = new List <OSProfileCellData> (); if (controller.user != null) { if (!String.IsNullOrWhiteSpace(controller.user.Email)) { tableData.Add(new OSProfileCellData() { Label = controller.user.Email, Icon = new UIImage("icon-mail.png"), PhoneIcon = new UIImage() }); } if (!String.IsNullOrWhiteSpace(controller.user.MobilePhone)) { tableData.Add(new OSProfileCellData() { Label = controller.user.MobilePhone, Icon = new UIImage("icon-phone.png"), PhoneIcon = new UIImage("icon-mobile-nocircle.png") }); } if (!String.IsNullOrWhiteSpace(controller.user.HomePhone)) { tableData.Add(new OSProfileCellData() { Label = controller.user.HomePhone, Icon = new UIImage("icon-phone.png"), PhoneIcon = new UIImage("icon-home.png") }); } if (!String.IsNullOrWhiteSpace(controller.user.AddressCurrent.Line1)) { tableData.Add(new OSProfileCellData() { Label = controller.user.AddressCurrent.Line1, Icon = new UIImage("icon-street.png"), PhoneIcon = new UIImage() }); } if (!String.IsNullOrWhiteSpace(controller.user.AddressCurrent.ToLocationString("{2}{3}{4}"))) { tableData.Add(new OSProfileCellData() { Label = controller.user.AddressCurrent.ToLocationString("{2}, {3} {4}"), Icon = new UIImage("icon-city.png"), PhoneIcon = new UIImage() }); } tableData.Add(new OSProfileCellData() { Label = "Emergency Contact" }); tableData.Add(new OSProfileCellData() { Label = String.IsNullOrWhiteSpace(controller.user.EmergencyContactName) ? "We need your help!\nPlease provide emergency contact." : controller.user.EmergencyContactName, Icon = new UIImage("icon-user.png"), PhoneIcon = new UIImage() }); if (!String.IsNullOrWhiteSpace(controller.user.EmergencyContactPhone)) { tableData.Add(new OSProfileCellData() { Label = controller.user.EmergencyContactPhone, Icon = new UIImage("icon-phone.png"), PhoneIcon = new UIImage("icon-home.png") }); } } }
public OSProfileTableSource(OSProfileViewController parent) : base() { LoadRows(parent); }