Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9012763
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T03:05:25+00:00 2026-06-16T03:05:25+00:00

I have a list that I bind to an itemsControl. The first items bind

  • 0

I have a list that I bind to an itemsControl. The first items bind well be not the isChecked part.

Here is the code

var LstTemplates = Templates.Select(x=>new {TName=x.TemplateName,TId = x.Id, IsLinked = IsLinked(x.Id)});
itemsControlTemplates.ItemsSource = LstTemplates;

IsLinked is a function that returns a boolean

private bool IsLinked(int Id)
{
   return (AnotherList.Any(x=>x.id==Id));
}

In the XAML

<CheckBox CommandParameter="{Binding TId}" Content="{Binding TName}" IsChecked="{Binding IsLinked}" />

The above does not work… or rather, the app freezes and breaks on a totally unrelated code.

But if I take the same “{Binding IsLinked}” and output it to a messagebox or even to the content of checkbox, then it shows…

Where did I go wrong?

Update:
Okay, ignore the part where I said the code breaks at an unrelated code, that does misleading.

                  <ItemsControl Name="itemsControlTemplates" >
                        <ItemsControl.ItemTemplate>
                            <DataTemplate>
                                <StackPanel Orientation="Horizontal" Margin="2">

                                    <CheckBox CommandParameter="{Binding TId}" Content="{Binding TName}" IsChecked="{Binding IsLinked}" />
                                </StackPanel>
                            </DataTemplate>
                        </ItemsControl.ItemTemplate>
                    </ItemsControl>

When I output ‘IsLinked’ to the content, it displays. How do I get it to bind to ‘IsChecked’?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T03:05:26+00:00Added an answer on June 16, 2026 at 3:05 am

    IsChecked is trying to do a TwoWay binding… I don’t think this is possible on an anonymous type.

    Try

    IsChecked="{Binding IsLinked, Mode=OneWay}"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a set of list items in unordered lists that I bind the
I have an list of objects (PrintJob) that I bind to a DataGridView. Here
I have a List of customers that I'm trying to bind to a DataGridView.
I have a DataGridView that I am trying to bind to a list. I
I have a list that has two items: projects and groups. Projects can go
I have a List that contains items, for example: 1) https:\\10.12.23\\ 2) https:\\12.23.12.25\\ 3)
I have a ItemsControl in my program that contains a list of radio buttons.
I have a List that I want to bind to a DataGridView in a
i have 4 menu drop down list that i bind a click that calls
If I have a List<Tuple<DateTime,DateTime>> can I bind that to list box in wpf?

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.