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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T14:27:19+00:00 2026-05-11T14:27:19+00:00

This is no doubt a newbish question, but I have looked for an answer

  • 0

This is no doubt a newbish question, but I have looked for an answer to no avail. My setup is simple: I have a ListBox control defined in XAML and an ObservableCollection<MyClass> in the same class. I am binding the ObservableCollection<MyClass> to the ListBox.

Within the hierarchy of this ListBox in XAML, I want to bind to a given MyClass object, not to a child property of the MyClass object.

To clarify, I have XAML that looks like the following (I bind the ObservableCollection in code):

  <ListBox x:Name='MyListBox'>     <ListBox.ItemTemplate>      <DataTemplate>       <MyControls:SpecialControl MyClassObj='{Binding !!!}' />      </DataTemplate>     </ListBox.ItemTemplate>   </ListBox> 

Surely there is a way to get at the object of an ObservableCollection rather than being forced to bind to one of its child properties.

  • 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-11T14:27:20+00:00Added an answer on May 11, 2026 at 2:27 pm

    You do not have to specify a Path if you want to use the bound object itself:

    <ListBox x:Name='MyListBox'>   <ListBox.ItemTemplate>     <DataTemplate>       <MyControls:SpecialControl MyClassObj='{Binding}' />     </DataTemplate>   </ListBox.ItemTemplate> </ListBox> 

    BTW: Instead of your custom property, you can use the DataContext property of your control to bind the control to the object:

    <ListBox x:Name='MyListBox'>   <ListBox.ItemTemplate>     <DataTemplate>       <MyControls:SpecialControl DataContext='{Binding}' />     </DataTemplate>   </ListBox.ItemTemplate> </ListBox> 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This question has been asked again and again, but I have still a doubt.
I have this doubt, what parameter does control timeouts for JSESSIONID?. Specifically consider this
Answering this question and searching for references I have this doubt my self: *How
I doubt this is possible, but I was curious if you could have more
I have read about DFS and BFS many times but I have this doubt
I doubt this is possible but what I would like to do is have
No doubt this might be a duplicate question but I am not able to
I am currently working on kerberos, and for now have this doubt on PAC
I doubt this is possible, but here's what I want to do. If my
I have no doubt this has been asked and answered here a dozen times,

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.