我正在尝试在SilverLight中创建我的第一个程序。但是我不能使用InkCanvas。
简单地说,我只是:
但是我无法看到或使用Canvas。
这是XAML:
<UserControl 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"
xmlns:Workspace="clr-namespace:Microsoft.Expression.Prototyping.Workspace;assembly=Microsoft.Expression.Prototyping.Runtime"
x:Class="SilverlightApplication3.MainPage"
mc:Ignorable="d"
d:DesignHeight="300"
d:DesignWidth="400">
<Grid x:Name="LayoutRoot"
Background="White">
<Workspace:InkCanvas HorizontalAlignment="Left"
Height="204"
Margin="36,52,0,0"
VerticalAlignment="Top"
Width="310"
Background="Black" />
</Grid>
</UserControl>
然后我得到了这两个错误:
错误1未定义的CLR命名空间。 'clr-namespace'URI是指a 命名空间'Microsoft.Expression.Prototyping.Workspace',但不能 被发现。 c:\ users \ xperator \ documents \ visual studio 2012 \ Projects \ SilverlightApplication3 \ SilverlightApplication3 \ MainPage.xaml 6 21 SilverlightApplication3
和
错误2找不到“工作区:InkCanvas”类型。验证你 不会错过程序集引用和所有引用 组件已经建成。 c:\ users \ xperator \ documents \ visual studio 2012 \ Projects \ SilverlightApplication3 \ SilverlightApplication3 \ MainPage.xaml 12 10 SilverlightApplication3
如错误所示,Prototyping命名空间中没有Workspace
。我可以在Solution explorer中看到,只有2个与InkCanvas相关的Reference:
Microsoft.Expression.Prototyping.Interactivity
microsoft.expression.prototyping.runtime
尝试从“添加引用”添加“工作区”但找不到它。
更新:
我认为InkCanvas实际上还没有正式移植到silverlight。试图在一台新电脑上做同样的步骤,我刚刚注意到InkCanvas不在那里。也许与Blend相关的东西在我自己的PC中添加了原型控件。它仍然无效:(
我对InkCanvas的替代品有任何建议。