Closed deepaksm1 closed 8 years ago
We have created checkbox list in ItemsControl. First time check box click not working. It is not getting checked. After second click it works.
<ItemsControl ItemsSource="{Binding Path=Services}" > <ItemsControl.ItemTemplate> <DataTemplate> <StackPanel Orientation="Horizontal"> <CheckBox IsChecked="{Binding Path=IsSelected, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Checked="{EventBinding Command={Binding DataContext.Checked, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type ScrollViewer}}, CommandParameter={Binding}}}" Unchecked="{EventBinding Command={Binding DataContext.Unchecked, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type ScrollViewer}}, CommandParameter={Binding}}}" /> <TextBlock Text="{Binding Path=Description}" Foreground ="White" FontSize="16" /> </StackPanel> </DataTemplate> </ItemsControl.ItemTemplate> </ItemsControl>
We have created checkbox list in ItemsControl. First time check box click not working. It is not getting checked. After second click it works.