Hello.
When i use listView.DataSource.Refresh() or listView.DataSource.RefreshFilter() the whole app bacame really slow on IOS. Scrolling take more then 3 sec. Android is ok.
Latest VS 19 and every package up to date.
Some code for refreshfilter:
private void OnFilterTextChanged(object sender, TextChangedEventArgs e)
{
searchBar = (sender as SearchBar);
if (listView.DataSource != null)
{
listView.DataSource.Filter = FilterContacts;
listView.DataSource.RefreshFilter(); //Whitout this line the app keep fast, but search not working
listView.ScrollTo(0);
}
}
private bool FilterContacts(object obj)
{
if (searchBar == null || searchBar.Text == null)
{
return true;
}
PhonebookEntry contacts = obj as PhonebookEntry;
return contacts.Contain(searchBar.Text.ToLower());
}
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<SearchBar x:Name="filterText" HeightRequest="40" TextChanged="OnFilterTextChanged" Grid.Row="0"/>
<listview:SfListView x:Name="listView" Grid.Row="1" ItemSize="120" AutoFitMode="DynamicHeight" SelectionMode="Single" SelectionGesture="Tap" SelectionBackgroundColor="Transparent" ItemsSource="{x:Static local:Phonebook.VM}" IsScrollBarVisible="False" Padding="8" ItemSpacing="8" BackgroundColor="Transparent" AllowSwiping="True" >
<listview:SfListView.ItemTemplate>
<DataTemplate>
<cards:SfCardView CornerRadius="4" HasShadow="True" WidthRequest="343" BackgroundColor="{DynamicResource Gray-White}" HorizontalOptions="Center" Padding="16,16,8,16">
...
</cards:SfCardView>
</DataTemplate>
</listview:SfListView.ItemTemplate>
</listview:SfListView>
</Grid>
What i do wrong?