【发布时间】:2012-03-05 17:42:29
【问题描述】:
我是 WPF / Silverlight 的新手,所以我很难描述我尝试做的事情。也许这就是我在 Stackoverflow 和 Google 上找不到答案的原因。
我尝试以编程方式绑定到DependyProperty。
public static DependencyProperty MyDependencyProperty
= DependencyProperty.RegisterAttached(
"...",
typeof(...),
typeof(...),
new PropertyMetadata(...)
);
xmlns:MyXMLNS="clr-namespace:...."
<ListBox MyXMLNS:MyClass.MyDependencyProperty="...">
// ....
</ListBox>
这已经按预期工作了。
如何以编程方式完成这项工作?
【问题讨论】:
标签: c# wpf silverlight xaml data-binding