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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T23:44:37+00:00 2026-05-10T23:44:37+00:00

If I have two objects, one being the list of items, and the other

  • 0

If I have two objects, one being the list of items, and the other having a property storing the selected item of the other list, is it possible to update the selected item through binding in WPF?

Lets say I have these two data structures:

public class MyDataList {     public ObservableCollection<Guid> Data { get; set; } }  public class MyDataStructure {     public Guid ChosenItem { get; set; } } 

Is it possible to bind a Listbox to an instance of both objects so that the ChosenItem property gets set by the selected item of the ListBox?

EDIT: To make things a bit clearer, there might be many instances of MyDataStructure, each with a chosen item from MyDataList. The data list is common to all the instances, and I need a way to select an item and store that selection in the MyDataStructure.

  • 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-10T23:44:37+00:00Added an answer on May 10, 2026 at 11:44 pm

    I believe you should be able to do this (make sure to declare the local namespace):

    <Window.Resources>     <local:MyDataStructure x:Key='mds1' /> </Window.Resources>     <ListBox ItemsSource='{Binding Data}' SelectedValue='{Binding Source={StaticResource mds1} Path=ChosenItem}'/> 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two UIImageView objects inside my view (both 320x480 one above the other).
I have one custom action (add) and two custom objects (favorites list) and (tv
I have a class that contains objects of two other classes. I need one
I have two threads, one reading streams and producing data-objects from their content. I
Say I have two 2D vectors, one for an objects current position and one
I have a List object being accessed by multiple threads. There is mostly one
I have two similar (not identical) dlls, one of them being actually a part
I have converted an array to object data like this: <?php $myobject->data = (object)Array('zero','one','two');
I have a junction object, Purchase, with two master-detail relationships. One with Customer and
I have two objects I need to create a relationship between in Core Data.

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.