以下是我的XAML代码:
<ListView ItemsSource="{Binding Path=ViewModel.Rows}"
x:Name="LView" HorizontalAlignment="Left" Height="401" Margin="10,52,0,0" VerticalAlignment="Top" Width="504">
<ListView.View>
<GridView>
<GridViewColumn x:Name="Expressions"
Width="250"
Header="Expression"
DisplayMemberBinding="{Binding Expression}">
</GridViewColumn>
<GridViewColumn x:Name="Tele"
Width="50"
Header="In Tele?">
<GridViewColumn.CellTemplate>
<DataTemplate>
<CheckBox x:Name="telCheck"
DataContext="{Binding}"
IsEnabled="True"
IsChecked="{Binding Path=Tel, UpdateSourceTrigger=Explicit}"></CheckBox>
</DataTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>
</GridView>
</ListView.View>
</ListView>
如何获取telCheck
的绑定表达式(即复选框的isChecked
属性)?在我的代码中,对于名为TextBox
的{{1}},我执行了以下操作:
NameBox
答案 0 :(得分:1)
尝试将UpdateSourceTrigger更改为 PropertyChanged ,然后Tel属性应具有该值。