0
Answer

Access Checkbox inside list box in C# in Windows Phone

sajid raja

sajid raja

11y
1.4k
1
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.