方法一
[assembly:TagPrefix("CustomControls", "custom")]
namespace CustomControls
{
// Simple custom control
public class ExListBox: Control
{
//....
}
CustomControls是指命名空间,custom指希望使用的TagName
方法二
在自定义控件的AssemblyInfo.cs中添加如下代码
[assembly:TagPrefix("CustomControls", "custom")]
CustomControls是指命名空间,custom指希望使用的TagName
本文介绍了两种在.NET中设置自定义控件TagPrefix的方法,包括在命名空间中定义及在AssemblyInfo.cs文件中添加特性的方式,便于在XAML等场景下使用。
33

被折叠的 条评论
为什么被折叠?



