Ok, so this may be a bit of a silly question, and there\'s certainly the obvious answer, but I was curious if I\'ve missed any subtleties here.
Is there any differen
Just faced with another example where there is difference between those two, when used from XAML in WPF.
XAML:
Code with internal
enum compiles successfully:
internal class Foo
{
internal enum Bar
{
e1,
e2,
}
}
But surprisingly changing it to public
results in error:
internal class Foo
{
public enum Bar
{
e1,
e2,
}
}
The last example produces compilation error:
error MC3064: Only public or internal classes can be used within markup. 'Bar' type is not public or internal.
Unfortunately, I can't explain what's wrong with public
in this case. My guess is "just because WPF works that way". Just change modifier of the nested class to internal
to get rid of error.