0

Assuming I have a class derived from Shape. I'm looking for way how to implement support for binding it with datatemplate. A datatemplate looking something like this:

<DataTemplate>    
  <Grid x:Name="grid">
        <Path x:Name="path" Data="F1 M 0.0692474,6.76634C -2.5902,6.76634 -4.91351,8.20551 -6.16436,10.3475L 0.0665311,-10.3179L 6.29167,10.3284C 5.03818,8.19696 2.72079,6.76634 0.0692474,6.76634 Z " />
  </Grid>
</DataTemplate>

It's clear for me how to apply Datatemplate to controls, such as buttons, textboxs, listviews and so on.

4

1 回答 1

0

TemplatePartAttribute做你喜欢 的事。有关如何编写支持模板的自定义控件以及如何在其中混合形状的信息,请参阅本教程。

于 2012-06-05T05:36:36.067 回答