2013-02-02 71 views
0

我已经使用silverlight 4创建了一个简单的测试类库,并且我想在WP7项目中使用它。在WP7项目中引用Silverlight类库

我引用了WP7项目中的dll,并且无法使用我创建的控件。在使用控件之前,我需要知道应该将哪些语句添加到我的xaml文件中。

这是类库的XAML文件(仅限矩形):

<UserControl x:Class="NabbeshControls.ProfileBox" 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    mc:Ignorable="d" 
    d:DesignHeight="300" d:DesignWidth="400"> 

    <Grid x:Name="LayoutRoot" Background="White"> 
     <Rectangle Fill="#FFABABFF" Margin="10" Stroke="Black"/> 
    </Grid> 
</UserControl> 

谢谢...

回答

2

假设命名空间库中的控制是“NabbeshControls”和DLL称为“Nabbesh.dll”,将以下内容添加到您想要使用它的XAML的顶部:

xmlns:tryNabbesh="clr-namespace:NabbeshControls;assembly=Nabbesh" 
相关问题