Good morning,

I'm developing for windows phone 8 and i encountered a problem.

I have a CheckBox alone (with the function of select all types) and below i have a LongListSelector with an itmsSource of a list and has a DataTemplate witch has a CheckBox for each item of the list.

Here is my XAML code:
Code:
 <CheckBox x:Name="cbAllBranches" Unchecked="cbAllBranches_Unchecked_1" Checked="cbAllBranches_Checked_1" Margin="-10,0,0,0" HorizontalAlignment="Left" Grid.Row="2" VerticalAlignment="Top">
                        <CheckBox.Content>
                            <TextBlock x:Name="tbAllBranches" Text="all branches" Style="{StaticResource Currencies}" FontSize="26"/>
                        </CheckBox.Content>
                    </CheckBox>

                    <phone:LongListSelector x:Name="llsBranches" Grid.Row="3">
                        <phone:LongListSelector.ItemTemplate>
                            <DataTemplate x:Name="dataBranches">
                                <!-- IsChecked="{Binding ElementName=cbAllBranches, Path=IsChecked, Converter={StaticResource IsCheckedConverter}, Mode=OneWay}"-->
                                <CheckBox x:Name="cbbranch" BorderBrush="#0F5985" Unchecked="cbbranch_Unchecked_1" Checked="cbbranch_Checked_1" HorizontalAlignment="Left" Margin="-10,0,0,0" VerticalAlignment="Top">
                                    <CheckBox.Content>
                                        <StackPanel Orientation="Horizontal" VerticalAlignment="Top" Margin="0,-7,0,0">
                                            <Image Source="/Assets/icons/Maps/map_millenniumbank.png" Stretch="UniformToFill" Width="50" Height="50"/>
                                            <TextBlock Margin="10,0,0,0" x:Name="tbRetail" Text="{Binding}" Style="{StaticResource Currencies}" FontSize="26"/>
                                        </StackPanel>
                                    </CheckBox.Content>
                                </CheckBox>
                            </DataTemplate>
                        </phone:LongListSelector.ItemTemplate>
                    </phone:LongListSelector>
The problem is, when i Check the "all items" CheckBox i want to run the list and check all CheckBoxes inside it.

I have the following code to do it:

Code:
  for (int i = 0; i < llsBranches.ItemsSource.Count; i++)
            {
                var cont = dataBranches.LoadContent();

                  (cont as CheckBox).IsChecked = true;

            }
it finds the checkBoxes, put the IsChecked property true for all, but when the cycle ends the property returns to false and the checkBoxes stay unChecked.

Can anyone Help me how to resolve this?