Error when adding a property to my XAML code

Sebastian Martinez Santos 21 Reputation points
2022-12-28T02:22:23.413+00:00

When I try to add KeyDown="Window_KeyDown" to my window, It does not display any errors. When I try to run the program, It shows a compilation error.
274451-image.png

274435-image.png

274380-image.png

By removing KeyDown="Window_KeyDown" the program runs normally. The error also occurs with any other type of object, from labels to textboxes.

My question is why it is not showing me any kind of error, but not allowing me to run it.

Probably a stupid question, sorry, but it's driving me crazy. thanks!

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,457 questions
VB
VB
An object-oriented programming language developed by Microsoft that is implemented on the .NET Framework. Previously known as Visual Basic .NET.
2,276 questions
XAML
XAML
A language based on Extensible Markup Language (XML) that enables developers to specify a hierarchy of objects with a set of properties and logic.
678 questions
{count} votes