Just ran into another example, where is the difference between the two when used from XAML to WPF.
XAML:
<Button Tag="{x:Static vm:Foo+Bar.e1}" />
Code with internal enum successfully compiles:
internal class Foo { internal enum Bar { e1, e2, } }
But unexpectedly changing it to public leads to an error:
internal class Foo { public enum Bar { e1, e2, } }
In the last example, a compilation error occurs:
error MC3064: only public or internal classes can be used in markup. The type "Bar" is not public or internal.
Unfortunately, I canβt explain what happened to public in this case. I assume that "just because WPF works that way." Just change the modifier of the nested class to internal to get rid of the error.
nevermind Oct 08 '15 at 2:59 a.m. 2015-10-08 14:59
source share