WPF C# - Update progressbar from another thread

前端 未结 4 1884
星月不相逢
星月不相逢 2020-12-14 03:35

I\'m stuck trying to update a progressbar from other threads ran in a different class. To explain what I do I think a picture will be better. I want to update the progressba

4条回答
  •  轮回少年
    2020-12-14 04:16

    You should be able to use the Dispatcher.Invoke method

    e.g.

        Dispatcher.Invoke(
            new System.Action(() => myProgressBar.Value = newValue)
            );
    

提交回复
热议问题