Making a XAML file internal in .NET

后端 未结 1 1093
有刺的猬
有刺的猬 2021-02-05 00:11

In my Silverlight project, I would like to make an assembly which contains .xaml that can\'t be seen from outside of the assembly. However, there is no clear way I can do this.

相关标签:
1条回答
  • 2021-02-05 00:50

    You need to add a x:ClassModifier="internal" in the UserControl tag of the XAML file if you change the visibility of the class in the .cs file to internal.

    The file generated from the XAML file (e.g. MyControl.g.cs) needs to match the code-behind file (e.g. MyControl.cs). x:ClassModifier allows you to control the visibility of the part declaration in the MyControl.g.cs file.

    0 讨论(0)
提交回复
热议问题