C
C#2y ago
arch_il

✅ cannot be accessed with an instance reference

public static class Details
{
// class for drawing event
public class EventDrawModel
{
public static string title { get; set; }
}

// model for drawing event
private static EventDrawModel eventDrawModel = new EventDrawModel();

// this is specific update func only called when selected event is changed
public static void Update()
{
Details.eventDrawModel.title = "";
}
}
public static class Details
{
// class for drawing event
public class EventDrawModel
{
public static string title { get; set; }
}

// model for drawing event
private static EventDrawModel eventDrawModel = new EventDrawModel();

// this is specific update func only called when selected event is changed
public static void Update()
{
Details.eventDrawModel.title = "";
}
}
Member 'Details.EventDrawModel.title' cannot be accessed with an instance reference; qualify it with a type name instead
Member 'Details.EventDrawModel.title' cannot be accessed with an instance reference; qualify it with a type name instead
How would one fix this issue?
2 Replies
Patrick Square
I am not too sure what you're doing, but it seems that title is a static property It should be accessed from the class itself rather than an instance of that class
arch_il
arch_ilOP2y ago
oh my bad. i should probably take a break thx for help
Want results from more Discord servers?
Add your server