Is there such a function like sleep(seconds) but it wouldn't block UI updates? I have a code like this and if I put threading sleep after (letters.Children[Words[index].index] as TextBlock).Text = Words[index].LetterCorrect; (I want to sleep after that) it just waits 1 sec and then UI gets updates, but I dont want that.
private void Grid_Click(object sender, RoutedEventArgs e) { if (index == Words.Count() - 1) return; if ((((e.Source as Button).Content as Viewbox).Child as Label).Content.ToString() == Words[index].LetterCorrect) { (letters.Children[Words[index].index] as TextBlock).Text = Words[index].LetterCorrect; letters.Children.Clear(); LoadWord(++index); this.DataContext = Words[index]; } }