How do you compose DataTemplates / link to a child datatemplate in WPF?

Posted by Gishu on Stack Overflow See other posts from Stack Overflow or by Gishu
Published on 2010-05-18T11:06:10Z Indexed on 2010/05/18 11:11 UTC
Read the original article Hit count: 170

Filed under:
|

Here's the problem.
Given a large/intricate datatemplate A, which has 3 sections - General, Properties, Misc. Imagine 3 grids for each.
Now I need to reuse the Properties section of the above Datatemplate in another place. Reasons: To avoid redundancy + ensure that further updates to the datatemplate are applied identically to all usages.

So I guess what I am asking for is an ability to slot in a link to a child DataTemplate in a parent Datatemplate. What's the best way to go about this ?

I found one way to do this.. but I'm not sure if its the right way or the best.. Posting it as an answer below so that it can be rated.

© Stack Overflow or respective owner

Related posts about wpf

Related posts about datatemplate