I have an application written in C# WPF that has a tree/folder structure which displays an ObservableCollection containing many items.
There is a filter feature where a user can input values and a search will be automatically performed and updated live on the main UI. Similar to where if you are searching something on Google's search engine and an AutoSuggestion box pops out which updates every time you enter a new character or word.
There is a scenario where if the collection has MANY datasets (over 100,000 items) and as soon as i start backspacing the values I've inputted (ex. from after inputting abcd into the textbox to abc to ab from backspacing) the main UI of my application freezes and just completely crashes the program. I figured creating a separate thread to perform this action (turning the method to an async and using await Task.Run() as follows would be the simplest solution but Visual Studio is telling me that a thread outside of the main UI thread cannot make changes to the Observable Collection. After a quick google search it seems like this is actually not suggested so I want to know if there are any other ways to get around this?