✅ Inconsistent accessibility: property type is less accessible than property.
Hey! I'm making a UWP app, but from my understanding this is universal to C#. I have 2 different UWP Pages, that are both a
public sealed partial class
public sealed partial class
. In one of them, namely MainPage, I have a list (ObservableCollection to be precise, but I've tried changing to a normal List and it gives the same error) This is said list:
static ObservableCollection<CustomObject> MyList { get; } = new ObservableCollection<CustomObject>();
static ObservableCollection<CustomObject> MyList { get; } = new ObservableCollection<CustomObject>();
I want to access this in the second Page, let's just call it Page2. I try to call MainPage.MyList, but can't because of the lists protection level. So I change the list to be
public
public
, and now I have an inconsistent accessibility. I'm having a hard time understanding what the error means exactly, can someone clear things up for me? How am I supposed to access the property from Page2?