C#C
C#2y ago
Falco

MainWindow' does not contain a definition for 'Button_Click'

Why is this occuring? Even if I delete the method in my code, and the xalm code for the button, the error is still there. Even if I rebuild/save/restart my project.

Things I've already tried which should solve it according to the internet:
  • Make sure namespace matches Xaml and in code(Both have EpicUnfriender)
  • I deleted bin/obj and restarted project
  • Deleted both xalm code for the button, and method Button_Click but error still occurs
Code:
using System.Windows;
using System.Windows.Input;
using NHotkey.Wpf;
using NHotkey;

namespace EpicUnfriender
{
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();;
        }
        // StartButton
        public void Button_Click(object sender, RoutedEventArgs e){}
    }
} 
image.png
Was this page helpful?