在此代码上:
<DataGrid ItemsSource="{Binding Path=Category.Reports}"
AutoGenerateColumns="False" CanUserAddRows="False" CanUserDeleteRows="False"
Name="_gridReports" SelectedItem="{Binding Report}">
<DataGrid.RowStyle>
<Style TargetType="DataGridRow">
<Setter Property="ContextMenu">
<Setter.Value>
<ContextMenu DataContext="{Binding Path=PlacementTarget.DataContext, RelativeSource={RelativeSource Self}}">
<MenuItem Header="Удалить" Click="OnDeleteClick"
IsEnabled="{Binding Path=IsDefault, Converter={StaticResource toBoolConverter}}"/>
<MenuItem Header="Редактировать" Click="OnEditClick"
IsEnabled="{Binding Path=IsDefault, Converter={StaticResource toBoolConverter}}" />
</ContextMenu>
</Setter.Value>
</Setter>
</Style>
</DataGrid.RowStyle>
<DataGrid.Columns>
<DataGridTextColumn Binding="{Binding Name}" Header="Название" IsReadOnly="True" />
<DataGridTextColumn Binding="{Binding Description}" Header="Описание" IsReadOnly="True" />
</DataGrid.Columns>
</DataGrid>
编译器几乎创建了该错误消息(从俄语翻译,可能有一些错误):
Invalid value "OnDeleteClick". "Click" is not event for "System.Windows.Controls.DataGridTextColumn"
希望你能帮助我!请