So, we are trying to display information using a Linq statement yet the issue we are having is we don't want some elements to be created if a variable is "" - Currently we are unable to do this as we cannot include an 'if' statement within the linq statement. How would we get around this; the code we have is listed below.
(E.g - We don't want the 'x.Phone' element to show if it is set to "")
Root = new RootElement ("Student Guide") {
new Section("Contacts"){
from x in AppDelegate.getControl.splitCategories("Contacts")
select (Element)new RootElement(x.Title) {
new Section(x.Title){
(Element)new StyledStringElement("Contact Number",x.Phone) {
BackgroundColor=UIColor.FromRGB(71,165,209),
TextColor=UIColor.White,
DetailColor=UIColor.White,
},
}
},
},
};