2
다른 변형으로 여러 번 요청되었지만 작동하지 못합니다. (A datagridTemplateColumn.cellTemplate에서) 체크 박스가wpf bind checkbox 명령 내 DataGridTemplateColumn.CellTemplate
<DataGrid ItemsSource="{Binding TransactionTypes}" AutoGenerateColumns="False" CanUserAddRows="False" x:Name="TransTypesGrid">
<DataGrid.Columns>
<DataGridTemplateColumn>
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<CheckBox IsChecked="{Binding IsSelected, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
Command="{Binding DataContext.UpdateCommand, ElementName=TransTypesGrid}" />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTextColumn Header="Transaction Type" Binding="{Binding TransTypeDesc}" />
</DataGrid.Columns>
내 뷰 모델
public DelegateCommand UpdateCommand { get; set; }
public myConstructor()
{
this.UpdateCommand = new DelegateCommand(Update);
}
private void Update()
{
//this stuff works, it's just not getting called when a checkbox get's (un)checked
//stuff that goes though the DataGrid's item source's IsSelected property
}
을 내보기를 클릭 할 때 내 뷰 모델에서 호출하는 방법을 얻으려고