Reputation: 1507
I'm trying to figure out why this is not working...
public static class ApplicationType
{
private static ApplicationEnum application = ApplicationEnum.App1;
public static ApplicationEnum Application
{
get { return application; }
set { application = value; }
}
public enum ApplicationEnum
{
App1,
App2,
App3
}
}
I want to access Application
from another class, such as...
public partial class MainWindow : Window
{
ApplicationType. //<-- Intellisense shows only ApplicationEnum }
Thanks.
EDIT: Problem was that I was not trying inside the MainWindow as in this example as I thought I was.
Upvotes: 1
Views: 2411
Reputation: 1503984
You're in the middle of a class declaration. You need to declare a field, method etc. For example, this should be fine (if you make ApplicationEnum
public):
private ApplicationEnum foo = ApplicatoinType.Application;
Until you've made ApplicationEnum
public, you'll find that your Application
property will fail to compile - you can't declare a public property of a type which isn't itself public.
Upvotes: 8