WPF - Cannot change a GUI property inside the OnChanged method (fired from FileSystemWatcher)
问题 I want to change a GUI property in the OnChanged method... (in actuality im trying to set an image source.. but used a button here for simplicity). This is called everytime filesystemwatcher detects a change in a file.. and it gets to the "top" output.. but catches an exception when it tries to set the button width. but if i put the same code in a button.. it works just fine. I sincerely don't understand why.. can someone help me? private void OnChanged(object source, FileSystemEventArgs e) {