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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T17:07:58+00:00 2026-05-11T17:07:58+00:00

I have a user control – say ControlBase. It has SomeItems property, which is

  • 0

I have a user control – say “ControlBase”. It has “SomeItems” property, which is an ObservableCollection<InheritedFromDO>, where InheritedFromDO is a class inherited from “DependencyObject”.
When I create markup for a child class of the ControlBase i’d like to initiate the “SomeItems” collection. But somehow I cannot use bindings in that markup, although the control has a pretty normal DataContext and binding works in normal cases.

It looks like this:

<local:ControlBase
   ...
   >
   <local:ControlBase.SomeItems>
     <SomeItem
       DepPropertyOne={Binding Id} <!-- Does NOT work here -->
       />
     <SomeItem
       DepPropertyOne={Binding Name} <!-- Does NOT work here -->
       />
   <local:ControlBase.SomeItems>

   <Grid>
     <TextBlock
       Text={Binding Id} <!-- Works here -->
       />
   </Grid>
</local:ControlBase>

The output says:

System.Windows.Data Error: 2 : Cannot find governing FrameworkElement or FrameworkContentElement for target element. BindingExpression:Path=Id; DataItem=null; target element is 'SomeItem' (HashCode=26965808); target property is 'DepPropertyOne' (type 'Object')

Any ideas how to make it work?

  • 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-05-11T17:07:58+00:00Added an answer on May 11, 2026 at 5:07 pm

    That’s because the items in the collection are not part of the logical tree. You need to customize the logical children of your control if you want that to work, or subclass a control that does it for you (eg. ItemsControl).

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

Sidebar

Related Questions

To explain confusing title, here is the deal. I have user control which has
I have user control named DateTimeUC which has two textboxes on its markup: <asp:TextBox
I have user control which has method as this public void DownloadFileAsync() { ThreadStart
I have user control for my sitemap which has following in ascx: <asp:SiteMapPath id=SiteMapPath1runat=server
I have a user control that has a public property defined in the code-behind
I have a user control named Navigation that has a property that holds navigation
i have user control, which i render on several views. i want to show
I have this User Control XAML: <Window x:Class=MyProj.Dialog xmlns=http://schemas.microsoft.com/winfx/2006/xaml/presentation xmlns:x=http://schemas.microsoft.com/winfx/2006/xaml xmlns:mc=http://schemas.openxmlformats.org/markup-compatibility/2006 xmlns:d=http://schemas.microsoft.com/expression/blend/2008 xmlns:shell=http://schemas.microsoft.com/winfx/2006/xaml/presentation/shell mc:Ignorable=d>
I have a user control with a div like this: <div runat=server id=pnlShippingMethods class=checkoutstep>
I have a user control with several buttons, which need to take different actions

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.