Document has no code-behind file

Tool: Visual Studio, PowerShell Module
Version: VS2019

Been working fine with PSTools and a WPF powershell project, until the other day whenever i go to event handelers for any button i get the below error,
“The document item has no code-behind file. Add a code-behind file and class definition before adding event handlers”

Had a look around and at a loss as to why this is now all of a sudden happened. Had no issues before and changes made to the project are all much the same as before adding various labels and textboxes etc. Tried a few searches and nothing seems to bring a definitive answer.

Hoping someone can help and point me in the right direction. This is all new to me using WPF and powershell so a learning curve as well.

I updated the Powershell pro tools before the error happened. Also when creating a brand new project i get the same.