A Microsoft framework for building cross-platform mobile apps using .NET and C# with native performance and user interfaces.
Hello, @Eduardo Gomez
why am I experiencing an Issue with my search bar, everything works fine, until I delete a character
This is because the 'FireBaseNotebookNotes' collection has been changed when entering a string. To ensure that the search is performed in the complete data collection, please retrieve the data before searching.
Here is the sample code, you could refer to it
public virtual async void TextToSearchAction(string SeachTerm)
{
if (!string.IsNullOrWhiteSpace(SeachTerm))
{
FireBaseNotebookNotes = await App.FirebaseService.ReadAsync(AppConstant.Notebooks);//add this line
var FilteredItems = FireBaseNotebookNotes.Where(item =>
item.Name.ToLowerInvariant().Contains(SeachTerm.ToLowerInvariant())).ToList();
FireBaseNotebookNotes.Clear();
foreach (var Item in FilteredItems)
{
FireBaseNotebookNotes.Add(Item);
}
}
else
{
FireBaseNotebookNotes = await App.FirebaseService.ReadAsync(AppConstant.Notebooks);
SearchBarVisibility = false;
ProfileVisibility = true;
}
}
Best Regards,
Jarvan Zhang
If the response is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.