我正在尝试使用以下代码Button
在中的每一行中创建一个:DataGrid
<DataGrid SelectionMode="Single" ItemsSource="{Binding Path=SettingsCollection}" SelectedItem="{Binding SelectedSettings, Mode=TwoWay}" AutoGenerateColumns="False" Height="Auto" HorizontalAlignment="Stretch" Margin="5" Name="dataGrid1" VerticalAlignment="Stretch" Width="Auto" Grid.Row="1" CanUserAddRows="False">
<DataGrid.Columns>
<DataGridTemplateColumn Header="" CanUserResize="False" Width="38*" >
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<Button Command="{Binding ShowAdvancedSettings}" Name="btn" Visibility="Visible" Height="Auto" Width="Auto" />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
</DataGrid.Columns>
</DataGrid>
绑定不起作用。我做错了什么?