'How to access control from another thread? C#/WPF [duplicate]

How to change label in UserControl in UserControl from another thread?

Here is my code:

this.Dispatcher.Invoke(DispatcherPriority.Input,
                  new DelegateMethod(() => {
                    App.mainWindow.FirstUserControl.SecondUserControl.txtLbl.Content = "Hello!";
                  }));

Error:

System.InvalidOperationException: "The thread calling this cannot access the specified object because the object is owned by another thread."


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source