我需要创建一个 common DataGridTemplateColumn
,以便我可以在具有不同对象和属性的应用程序中使用它。
这是一些示例代码,我在我的项目中使用
<DataGridTemplateColumn Width="100*">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding Path=Age}"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
<DataGridTemplateColumn.CellEditingTemplate>
<DataTemplate>
<TextBox Text="{Binding Path=Age}"/>
</DataTemplate>
</DataGridTemplateColumn.CellEditingTemplate>
</DataGridTemplateColumn>
我需要一个通用版本的代码,以便我可以将其DataTemplate
放入app.xaml
并在我的代码中引用它