我有一个ListView
带有CheckBox
.
我想将所有 Checked 行的值保存在 WPF 列表中...
我怎样才能做到这一点?
我的列表视图
<ListView x:Name="listViewChapter" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" BorderThickness="0" SelectionMode="Single" Height="100" Margin="22,234,17,28" Grid.Row="1">
<ListView.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Left" VerticalAlignment="Center" >
<Label Name="lblChapterID" VerticalAlignment="Center" Margin="0" Content="{Binding ChapterID}" Visibility="Hidden" />
<CheckBox Name="chkChapterTitle" VerticalAlignment="Center" Margin="0,0,0,0" Content="{Binding ChapterTittle}" Checked="chkChapterTitle_Checked" />
</StackPanel>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>