mercredi 12 août 2015

How to store the checkbox state in windows phone

I have a checkbox under a listbox using the given xaml file . My xaml file:

<ListBox x:Name="notificationSettingsListBox" Grid.Row="1"   Margin="20,20,20,20" Background="#e79e38"  >
        <ListBox.ItemTemplate>
            <DataTemplate>
                <Grid Background="#055cc3" Width="500" Height="200" Margin="30,40,30,20">
                    <StackPanel Orientation="Vertical">
                        <TextBlock Text="{Binding channel_name}" Foreground="White" FontSize="31" TextAlignment="Left" TextWrapping="Wrap" Margin="0,20,10,0" />
                        <CheckBox x:Name="pushNotiOnCheckBox" Content="Enable Notification"  Checked="pushNotiOnCheckBox_Checked" Unchecked="pushNotiOnCheckBox_Unchecked"/>
                    </StackPanel>

                </Grid>
            </DataTemplate>
        </ListBox.ItemTemplate>
    </ListBox>

Suppose in my listbox i have 5 checkbox and the user just checks 2 of the checkbox. Now when the user lunches the app in next time it will show the checked state of these 2 checkbox which he previously checked.

How can i achieve that using these xaml file in windows phone ??




Aucun commentaire:

Enregistrer un commentaire