是否可以在没有ListBox或其他项控件的情况下,使用数据模板来处理单个项目?
我有一个数据模板,我想在xaml中实例化它,而不是在列表中,只在边框内,然后设置它的数据上下文。
类似于(伪代码):
<Window DataContext="{StaticResource Contact}">
<!--
Here I want to show a ContactTemplate for a single Contact
as it would appear in an ItemsControl (ListBox etc.)
-->
<src:ContactTemplate Source="{Binding}"/>
</Window>