This question has already been answered:
- Work with controls from background thread 2 responses
How to use timer in WPF?
I get the error:
InvalidOperationException was not handled by user code.
Because of a different thread of yours.
This question has already been answered:
How to use timer in WPF?
I get the error:
InvalidOperationException was not handled by user code.
Because of a different thread of yours.
A similar question was asked earlier and an answer has already been received. If the answers provided are not exhaustive, please ask a new question .
Try Dispatcher.Invoke . So
Dispatcher.Invoke( DispatcherPriority.Normal, new Action(() => progressBar1.Value++) );
Or the code which is resulted on the link in article on MSDN.
In WPF, you must use DispatcherTimer instead of Timer. It will work in the right stream.
Source: https://ru.stackoverflow.com/questions/106006/
All Articles