AsyncLocal value disappeared when Open a new window from loaded-event

fy w 1 Reputation point
2022-09-01T07:57:24.703+00:00

when I run a wpf App, I set value to a global AsyncLocal variable and open the Second window at the Loaded-Event of MainWindow,when I click a button of the second window,the value of global AsyncLocal variable is null.But if I do this at a button click-event,it's ok.so I try to simulation the button click-event to open the second event,but it didn't work.I don't know what's wrong.

Windows Presentation Foundation
Windows Presentation Foundation
A part of the .NET Framework that provides a unified programming model for building line-of-business desktop applications on Windows.
2,667 questions
{count} votes