I have a FileSystemWatcher and events related to this when the observed changes to the file are raised in another thread from the user interface thread. To avoid and cross with acce volase fun, I'm trying to use
public void RaisePathChanged(object sender, RenamedEventArgs e) { Dispatcher.CurrentDispatcher.BeginInvoke(new Action(() => {
This compiles fine, and RaisePathChanged starts as it should. However, the code inside the delegate Action(() => { /*Here*/ }) never called / called, the code is simply skipped.
Why is the code missing, how can I fix it, and is this the best way to ensure that the code runs in the thread that created it in WPF?
Thank you for your time.
c # wpf dispatcher
Moonknight
source share