Add a method to WPF?

I'm currently trying out WPF. How can I add methods to the main code? When I do this, I always get an error:

When I press Alt + Enter to suggest possible improvements, nothing happens. What can I do?

(1 votes)
Loading...

Similar Posts

Subscribe
Notify of
2 Answers
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Suiram1
11 months ago

A method can never be located outside a class in C#, but it is in your namespace. You mean you need to move it to the MenuBar class.

Well-meaning advice: just get a real deal with C# and try out console apps before you start with WPF. C#, unlike languages like Python, is not a language in which you quickly get ‘big’ results as a beginner.