I've already checked similar questions like
CS0120: An object reference is required for the nonstatic field, method, or property 'foo'
An object reference is required for the nonstatic field, method, or property
an object reference is required for the nonstatic field method or property
I have the following code in a Window:
public partial class RegistrationWindow : Window
{
...
...
public RegistrationWindow()
{
InitializeComponent();
this.Loaded += Init;
}
private void Init(object sender, EventArgs e)
{
RegistrationFunctions.GotoStep(this, 1); // <-- here the error occurs
}
}
and I have the following class:
public class RegistrationFunctions
{
public void GotoStep(RegistrationWindow window, int step)
{
...
...
}
}
I'm not using any static
class or method, but I'm still getting the following error:
An object reference is required for the non-static field, method, or property...
Why am I getting this error even when I don't have anything static
??