Can I define CellTemplate of DataGrid as a Resource so that it can be reused in multiple columns?
问题 I want a specific template for all my columns in DataGrid. The usual method is I will replicate the entire XAML for DataTemplate multiple times in the DataGrid in each of the Column. Is there any way I can define the CellTemplate globally as a resource and then just pass the the "Path" property of "Binding" to it, so that it displays the correct item from the DataContext ? Is this possible ? 回答1: Create DataTemplate in App.Xaml file with key/name. <DataTemplate x:Name="myTemplate" TargetType=