Problem on visual studio 2022


I have a problem with my visual studio code when i try to make the link between my code .xaml and my code .ps1

I have follow the youtube video : Building a WPF Form with PowerShell in Visual Studio 2019 - YouTube
for make this relation.

My error in the properties of my Label : "The document element does not have a code-behind file.
Add a code-behind file and class definition before adding event handlers.

Thank you