Hi
I would like to have a header in listview only if there aren't item in a listview.
If i write something like
if(App.ListaSoggetti == null)
_listView.Header = new Label() {
Text="Nessun dato",
XAlign = TextAlignment.Center,
FontSize = Library.GetFontNamedSize(NamedSize.Large, typeof(Label)),
HorizontalOptions = LayoutOptions.CenterAndExpand};
else
try{
_listView.Header = null;
}
catch(Exception ex){
DisplayAlert("Errore", ex.Message, "Ok");
}
If App.ListaSoggetti == null, I have "Nessun dato" in the header, but if I call again this code with App.ListaSoggetti != null, the
_listView.Header = null;
freeze the app.
If I write
_listView.Header = "";
instead of
_listView.Header = null;
it works but I see an empty header (I would like not to have an empty header, I would like to have no header)
How can I remove the header from the list?