I am developing a Windows Phone 8 App in which I am using a checkbox inside a listbox along with some textblocks.
<ListBox x:Name="lstStudentSelect" ItemContainerStyle="{StaticResource ListBoxItemStyle1}" Background="Transparent" ScrollViewer.VerticalScrollBarVisibility="Visible" Height="487" BorderThickness="0" VerticalAlignment="Top" Margin="8,198,10,0">
<ListBox.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal">
<StackPanel Width="360" Orientation="Horizontal" HorizontalAlignment="Left">
<TextBlock Text="{Binding stunum}" Width="80" Foreground="Black" TextWrapping="Wrap" FontSize="20" VerticalAlignment="Center" />
<TextBlock Text="{Binding name}" Width="280" Foreground="Black" TextWrapping="Wrap" FontSize="20" VerticalAlignment="Center" />
</StackPanel>
<StackPanel Width="5"></StackPanel>
<StackPanel Width="150" Orientation="Horizontal" HorizontalAlignment="Right">
<CheckBox IsChecked="{Binding ChkFlag, Mode=TwoWay}" BorderBrush="#203485" Foreground="Black" BorderThickness="1" Tag="{Binding cusnum}" Name="cusCheck" Checked="cusCheck_Checked_2" Unchecked="cusCheck_Unchecked_2" ></CheckBox>
<TextBlock Text=" " TextWrapping="Wrap" Foreground="Black" FontSize="20" VerticalAlignment="Center" />
</StackPanel>
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
when I check/select on the checkbox the checkbox checked event fires, when I uncheck/unselect a checkbox the checkbox unchecked event fires.
But now my issue is :
When I am scrolling the listbox the checkbox checked and unchecked event fires automatically ?
How can I avoid this to happen ?