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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T13:59:24+00:00 2026-05-23T13:59:24+00:00

Is there a way to futher debug bindings other than using PresentationTraceSources.TraceLevel? I have

  • 0

Is there a way to futher debug bindings other than using PresentationTraceSources.TraceLevel?

I have a rather complex issue, where an ElementName-binding fails (the element is not found) when it is used on a CommandParameter on a Button that is a child on UserControl2 which is placed inside UserControl1. The output of PresentationTraceSources.TraceLevel=High is (PåstandsListe is UserControl2):

System.Windows.Data Warning: 52 : Created BindingExpression (hash=8957325) for Binding (hash=61342683)
System.Windows.Data Warning: 54 :   Path: 'SelectedItem'
System.Windows.Data Warning: 56 : BindingExpression (hash=8957325): Default mode resolved to OneWay
System.Windows.Data Warning: 57 : BindingExpression (hash=8957325): Default update trigger resolved to PropertyChanged
System.Windows.Data Warning: 58 : BindingExpression (hash=8957325): Attach to System.Windows.Controls.Button.CommandParameter (hash=426476)
System.Windows.Data Warning: 63 : BindingExpression (hash=8957325): Resolving source 
System.Windows.Data Warning: 66 : BindingExpression (hash=8957325): Found data context element: <null> (OK)
System.Windows.Data Warning: 70 :     Lookup name PåstandsListe:  queried Button (hash=426476)
System.Windows.Data Warning: 61 : BindingExpression (hash=8957325): Resolve source deferred
'Domstolene.JFS.GUI.vshost.exe' (Managed (v2.0.50727)): Loaded 'C:\Windows\assembly\GAC_64\System.Transactions\2.0.0.0__b77a5c561934e089\System.Transactions.dll', Symbols loaded.
System.Windows.Data Warning: 63 : BindingExpression (hash=8957325): Resolving source 
System.Windows.Data Warning: 66 : BindingExpression (hash=8957325): Found data context element: <null> (OK)
System.Windows.Data Warning: 70 :     Lookup name PåstandsListe:  queried Button (hash=426476)
System.Windows.Data Warning: 63 : BindingExpression (hash=8957325): Resolving source 
System.Windows.Data Warning: 66 : BindingExpression (hash=8957325): Found data context element: <null> (OK)
System.Windows.Data Warning: 70 :     Lookup name PåstandsListe:  queried Button (hash=426476)
System.Windows.Data Warning: 63 : BindingExpression (hash=8957325): Resolving source 
System.Windows.Data Warning: 66 : BindingExpression (hash=8957325): Found data context element: <null> (OK)
System.Windows.Data Warning: 70 :     Lookup name PåstandsListe:  queried Button (hash=426476)
System.Windows.Data Warning: 63 : BindingExpression (hash=8957325): Resolving source 
System.Windows.Data Warning: 66 : BindingExpression (hash=8957325): Found data context element: <null> (OK)
System.Windows.Data Warning: 70 :     Lookup name PåstandsListe:  queried Button (hash=426476)
System.Windows.Data Warning: 63 : BindingExpression (hash=8957325): Resolving source 
System.Windows.Data Warning: 66 : BindingExpression (hash=8957325): Found data context element: <null> (OK)
System.Windows.Data Warning: 70 :     Lookup name PåstandsListe:  queried Button (hash=426476)
System.Windows.Data Warning: 63 : BindingExpression (hash=8957325): Resolving source 
System.Windows.Data Warning: 66 : BindingExpression (hash=8957325): Found data context element: <null> (OK)
System.Windows.Data Warning: 70 :     Lookup name PåstandsListe:  queried Button (hash=426476)
System.Windows.Data Warning: 63 : BindingExpression (hash=8957325): Resolving source  (last chance)
System.Windows.Data Warning: 66 : BindingExpression (hash=8957325): Found data context element: <null> (OK)
System.Windows.Data Warning: 70 :     Lookup name PåstandsListe:  queried Button (hash=426476)
System.Windows.Data Error: 4 : Cannot find source for binding with reference 'ElementName=PåstandsListe'. BindingExpression:Path=SelectedItem; DataItem=null; target element is 'Button' (Name=''); target property is 'CommandParameter' (type 'Object')

Changes without any effect:

  • Binding to the parent element of
    UserControl2 instead of UserControl2.

Non-failing scenarios (here the ElementName-binding works):

  • UserControl2 is not placed within UserControl1.
  • Button is added as a child to UserControl1 instead of UserControl2.

Futhermore when I attach Snoop to the application the ElementName-binding starts working when I select the Button within Snoop (but no information is displayed in the VS Output window). Does Snoop somehow refresh the binding?

Update

It seems the problem only occurs when the Button is not initially visible, e.g. placed in an Expander og TabItem which are not visible.

  • 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-23T13:59:24+00:00Added an answer on May 23, 2026 at 1:59 pm

    Tabs and Expander controls usually do not create and initialize item unless they are visible, only when first time they are made visible, the items are created and initalized thats why first time the binding may fail. There is no such solution for this case when element is not created as it does not appear in visual tree.

    The reason is pretty simple, if you have a templated control, the template of control is not created till the control is visible and added in visual tree. Because of this reason, the items inside template do not exist and can not be bound to, now Tabs and Expander’s child etc are not created along with the parent.

    Snoop probably forces element to be created, and thats why it appears.

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

Sidebar

Related Questions

I was wondering if there was any decent way, other than NSLog-ing just about
Is there any way to check whether a file is locked without using a
There have been many threads started over the confusion in the way that Math.Round
Is there any way to make TypeDescriptor.GetConverter.ConvertFromString convert to DateTime using a custom format
Is there a way to directly connect to Redis using client side (not Node.js)
Is there way in next piece of code to only get the first record?
is there way thats i can preselect an item when the page loads or
Is there a way to enforce constraint checking in MSSQL only when inserting new
Is there a way to find the name of the program that is running
Is there a way to hide radio buttons inside a RadioButtonList control programmatically?

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.