Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我已经为页面资源中的 LongListSelector 中的项目定义了一个 DataTemplate,现在我想将此 DataTemplate 应用于代码隐藏文件中的 LongListSelector。我怎样才能做到这一点?
谢谢。
这很简单:
'NameOfList'.ItemTemplate = this.Resources["'NameOfDataTemplate'"] as DataTemplate;