Hi Guys,
i am testing an WinPhone Silverlight 8.1 Xamarin Forms Application. I have a StackLayout where i add an SearchBar and an ListView
search.TextChanged += (sender, e) => this.Filter(search.Text);
search.SearchButtonPressed += (sender, e) => this.Filter(search.Text);
Searching works perfect - however the application crashes
private void Filter(string filter)
{
listView.BeginRefresh();
if (string.IsNullOrWhiteSpace(filter))
listView.ItemsSource = activities;
else
listView.ItemsSource = activities.Where(a => !string.IsNullOrWhiteSpace(a.Subject) && a.Subject.ToLower().Contains(filter.ToLower()));
listView.EndRefresh();
}
Now when i often Change the Text - TextChanged is invoked - but the application crashes most of the time with an Layout cycle detected. Layout could not complete exception. I already tried to set the RowHeight to 40, which makes it better - but the application still crashes if i make many changes in the search text?