sajid raja

sajid raja

  • NA
  • 66
  • 47.3k

Access Checkbox inside list box in C# in Windows Phone

Jun 27 2013 12:00 PM
Hello
I am developing a windows phone application. I have created check box inside list box in XAML. Following is the XAML code

 <ListBox Name="lstcontacts" ItemsSource="{Binding}" Margin="10,52,10,113" SelectionMode="Multiple" Foreground="#FF333333" >
                <ListBox.ItemTemplate>
                    
                    <DataTemplate>
                        <StackPanel Orientation="Horizontal">
                            <CheckBox Name="contactChk" IsChecked="true" Foreground="Black" Background="Black" BorderBrush="Black" />
                            <TextBlock Name="txtResults" Text="{Binding Path=DisplayName, Mode=OneWay}"  />
                        </StackPanel>
                    </DataTemplate>
                </ListBox.ItemTemplate>
            </ListBox>


I want to access checkBox name contactChk via C# and want to access check box value in C#. but i am unable to access Check box in C#. Can anybody please tell me how can i do this.