在项目的“AssemblyInfo.cs”文件中加入如下代码:
引用的命名空间为:“using System.Windows.Markup;”
[assembly: XmlnsDefinition("http://schemas.cingsoft.com/2008/xaml/presentation", "Cing.Controls")]
[assembly: XmlnsPrefix("http://schemas.cingsoft.com/2008/xaml/presentation", "cingsoft")]
[assembly: XmlnsPrefix("http://schemas.cingsoft.com/2008/xaml/presentation", "cingsoft")]
在其他项目中使用的时候,将控件拖入界面中则自动生成:
xmlns:cingsoft="http://schemas.cingsoft.com/2008/xaml/presentation"
<cingsoft:CingButton Grid.Column="1" Grid.Row="2" HorizontalAlignment="Left" Margin="138,21,0,0" Name="cingButton1" VerticalAlignment="Top" />
很简单,如果还有不懂的可以留言。