I need to share data between classes in C#. Sounds easy enough. I have a collection that is loaded with data in a class. Let’s say it is defined like this:
public class AppAdmin: IApplicationThingy
{
public ObservableCollection<Data> DataCollection;
Now, in another class, I want to look at DataCollection. Both classes are in the same namespace. AppAdmin.DataCollection does not work. Can you help?
You have to have an instance of AppAdmin to access DataCollection
or if the design permits, you can make DataCollection static
and then you can access DataCollection as you mention in the question by