【发布时间】:2010-06-17 08:45:47
【问题描述】:
我正在尝试在这里学习 Silverlight,创建一个自定义控件模板,但是 VS2010 拒绝识别标记代码中的 ControlTemplate 类型,即使我已经引用了 System.Windows 和 System.Windows.Controls 程序集(由项目基于标准 Silverlight 应用程序模板时的默认设置)。我正在尝试重新创建this seen on another SO stack。
我已尝试将此代码直接放入文件(即 ImageButton.xaml)中,仅此而已:
<ControlTemplate x:Key="ImageButtonTemplate">
<Image Source="{TemplateBinding Content}" />
</ControlTemplate>
【问题讨论】:
-
添加引用 System.Windows.Controls
-
您是否引用了正确版本的程序集?
-
你能把你的代码放在这里吗..,指出哪里出了问题会很有帮助..:)
标签: silverlight xaml reference controltemplate custom-controls