Describe the bug
The framework invokes the INavigationAware callbacks through a Task.Run, which causes the callbacks to be run on the thread pool.
Any cross-thread exceptions that do occur within the callback are silently swallowed because the result of the task is discarded.
To Reproduce
Add the following code to an INavgiationAware callback:
if (Thread.CurrentThread != Application.Current.Dispatcher.Thread)
{
Debugger.Break();
}
Expected behavior
As this interface is intended to be implemented by view models, I expect the callbacks to be run on the UI synchronization context, allowing UI-bound properties to be modified without having to deal without posting the updates to the UI synchronization context manually.
Screenshots
No response
OS version
Windows 10
.NET version
.NET 9
WPF-UI NuGet version
4.0.0-rc.3
Additional context
No response
Describe the bug
The framework invokes the
INavigationAwarecallbacks through aTask.Run, which causes the callbacks to be run on the thread pool.Any cross-thread exceptions that do occur within the callback are silently swallowed because the result of the task is discarded.
To Reproduce
Add the following code to an
INavgiationAwarecallback:Expected behavior
As this interface is intended to be implemented by view models, I expect the callbacks to be run on the UI synchronization context, allowing UI-bound properties to be modified without having to deal without posting the updates to the UI synchronization context manually.
Screenshots
No response
OS version
Windows 10
.NET version
.NET 9
WPF-UI NuGet version
4.0.0-rc.3
Additional context
No response