20

I Have a data template that i use in items control, i wanna know if its possible some how to use it(the template) on single item display without the items control?

if not whats the best way to do it...?

Chen Kinnrot
  • 20,609
  • 17
  • 79
  • 141

1 Answers1

37

You can probably do something like this

**<DataTemplate x:Key="MyTemplate" DataType="{x:Type MyType}">**
    ...
**</DataTemplate>**
...
<ContentControl ContentTemplate="{StaticResource MyTemplate}" /> <!-- Single instance use -->
<ItemsControl ItemTemplate="{StaticResource MyTemplate}" /> <!-- Multiple instance use -->
sitilge
  • 3,687
  • 4
  • 30
  • 56
toxvaerd
  • 3,622
  • 3
  • 24
  • 29