我在复选框内容内有列表框。我希望每当列表框中发生任何单击事件时都选中该复选框。但是它不会检查的问题,只有单击文本块才能检查。有什么想法吗?
<CheckBox Checked="orderItemChecked"
Unchecked="orderItemUnchecked"
Grid.Column="0" Grid.Row="0" IsChecked="{Binding Path=Completed}"
HorizontalContentAlignment="Stretch" >
<StackPanel>
<TextBlock Text="{Binding Path=sItemName}" ></TextBlock>
<ListBox Grid.Row="1" HorizontalAlignment="Left" HorizontalContentAlignment="Stretch"
ItemsSource="{Binding Path=aSinglOptns}"
Margin="20,0,0,0"
ItemTemplate="{StaticResource SinglOptnTmpl}"
Style="{StaticResource SheetListStyle}"
ItemContainerStyle="{StaticResource ListBoxItemStyle}"/>
</StackPanel>
</CheckBox>
尝试从中关闭命中测试ListBox
:
<ListBox Grid.Row="1" IsHitTestVisible="false" ... />
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句