<Style x:Key="Body_Content_DataGrid_Centering"
TargetType="{x:Type DataGridCell}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type DataGridCell}">
<Grid Background="{TemplateBinding Background}">
<ContentPresenter VerticalAlignment="Center" />
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="CellFocusVisual" TargetType="{x:Type DataGridCell}">
<Setter Property="Control.Template">
<Setter.Value>
<ControlTemplate>
<Border>
<Rectangle StrokeThickness="0.5" Stroke="DarkGray"/>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
我想调用Datagrid中的两个样式CellStyle是否可以在App.XAML的WPF DataGrid中调用。显示错误,如下所示。