【发布时间】:2013-10-27 01:06:54
【问题描述】:
我有一个简单的类,我想通过 xaml 简单地创建我的类的实例。但我仍然收到如下错误:“'Test' 成员无效,因为它没有合格的类型名称。”
UserControl1.xaml.cs:
namespace WpfTestApplication1
{
public class UserControl1 : UserControl
{
public string Test { get; set; }
public UserControl1()
{
}
}
}
UserControl1.xaml:
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:WpfTestApplication1">
<local:UserControl1>
<Setter Property="Test" Value="aaaa" />
</local:UserControl1>
</ResourceDictionary>
请帮忙。
【问题讨论】:
标签: c# wpf xaml templates controls