Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WPF - Display single entity with a data template

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...?

like image 848
Chen Kinnrot Avatar asked Apr 16 '09 08:04

Chen Kinnrot


1 Answers

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 -->
like image 177
toxvaerd Avatar answered Oct 14 '22 06:10

toxvaerd