내보내기(0) 인쇄
모두 확장

x:ClassModifier Attribute

Modifies XAML compilation behavior in cases where x:Class is also provided. Specifically, instead of creating a partial class with a Public access level (the default), the provided x:Class is created with a NonPublic access value. This affects the access level for the class in the generated assemblies.

<object x:Class="namespace.classname" x:ClassModifier="NonPublic">
   ...
</object>

NonPublic

The exact string to pass to specifiy Public versus NonPublic varies, depending on the code-behind programming language being used. See Remarks.

x:Class Attribute must also be provided on the same element, and that element must be the root element in a page.

The value for the x:ClassModifier attribute will vary by programming language. The string to use will depend on how each language implements its CodeDomProvider and the type converters it returns to define the meanings for TypeAttributes.Public and TypeAttributes.NonPublic, and whether that language is case sensitive or not.

  • For C#, the string to pass to designate NonPublic is internal.

  • For Microsoft Visual Basic .NET, the string to pass to designate NonPublic is Friend.

  • For C++/CLI, the C++/CLI targets do not currently support compiling XAML.

You can also specify Public (public in C#, Public in Microsoft Visual Basic .NET) but that is uncommon, because Public as the behavior is already the default.

커뮤니티 추가 항목

추가
Microsoft는 MSDN 웹 사이트에 대한 귀하의 의견을 이해하기 위해 온라인 설문 조사를 진행하고 있습니다. 참여하도록 선택하시면 MSDN 웹 사이트에서 나가실 때 온라인 설문 조사가 표시됩니다.

참여하시겠습니까?
표시:
© 2014 Microsoft