In my app I’m saving data to my database (SQLite).
I don’t want to block my UI so I save the data in diffrent task
await Task.Run(() => this.SaveTracks(books, filesCollection));
I get TextBox from my dictionary with data
TextBox tmpTextBox = parseData["title_" + i] as TextBox;
When it wasn’t in diffrent Task it works great but when I’ve set in with Task.Run I get Exception that I can’t use it cause I invoke element in diffrent thread. How can I not block my UI by doing it in diffrent Task and get data from UI elements in main Thread
Get the
TextBox.Textvalue before you start the Task and pass that value as an argument.