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 175641
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T13:44:06+00:00 2026-05-11T13:44:06+00:00

I have created a custom panel (MyCustomControl) that can contain other controls and be

  • 0

I have created a custom panel (MyCustomControl) that can contain other controls and be configurable through dependency properties. Inside a different user control (MyUserControl), I have multiple instances of MyCustomControl configured in XAML.

Outside of the user control, I am trying to bind an ItemsControl (myItemsControl) to the list of MyCustomControls that exist in MyUserControl at run-time. Therefore, I have exposed the List from MyUserControl through a dependency property.

I am experiencing unexpected behavior from this strategy. I would like the ItemsControl to take the List and use each control instance inside as an object with data values that can fill in the ItemsControl’s DataTemplate. However, it is not doing that. Instead, it is basically ignoring the DataTemplate altogether, and simply re-rendering all the controls that are in the list/ItemsSource.

In summary, if I use a list of controls as an ItemsSource for an ItemsControl, it does not use them as data objects but instead renders them as control instances.

Surprisingly, if I attempt to do the same thing but use a ListBox instead of an ItemsControl, the databinding works as expected. I do not want to use a ListBox for other reasons. Does anyone know what the difference is between a ListBox and an ItemsControl that affects this behavior?

Edit: I’ve found another user who’s had the same issue with no listed resolution here: msdn social forum post

  • 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. 2026-05-11T13:44:07+00:00Added an answer on May 11, 2026 at 1:44 pm

    After using Reflector to examine the ItemsControl code, the IsItemItsOwnContainerOverride method returns true if the item is a UIElement. You can create a subclass of ItemsControl, and change this method to:

    protected override bool IsItemItsOwnContainerOverride(object item) {     return (item is ContentPresenter); } 

    If you then use that class instead of the ItemsControl, it will work as expected, but won’t have the undesired functionality of ListBox.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created a custom control (based on a panel) in wxPython that provides
I have created the custom control which is just a panel that I will
I have created a small flash CS4 project that has a few custom components
I'm interested in seeing what custom extensions other developers have created for the ASP.NET
I have an application that has created a number of custom event log sources
I have created a custom server control with properties implementing the ITemplate interface. It
I have created a custom control inheriting from a panel in .NET 3.5 The
I have created a custom control which derives from Panel. I use it to
I have a popup menu that displays dynamically created custom JPanel objects in a
We have a custom panel class that animates its children via an internal DoubleAnimation

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.