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

  • Home
  • SEARCH
  • 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 7834369
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T13:08:07+00:00 2026-06-02T13:08:07+00:00

I have an object stored in a database that I am retrieving in my

  • 0

I have an object stored in a database that I am retrieving in my viewmodel and placing into an observable collection. These objects are properties (houses/realestate) that each have a child object called Images. Each property can have multiple images (but each image can only have one property). I only want to use one viewmodel. I have the properties populating a listbox fine, and I can successfully bind the images to a subsequent listbox, but only if I do it via iList. My question is how do I implement the Images into an observable collection of their own (so I can monitor changes), in place of the iList. Here is the code of some of the features I mentioned above…

        public IList<Image> Images
    {
        get
        {
            if (CurrentProperty != null)
                return CurrentProperty.Images.ToList();
            return null;
        }
    }

 private void Load()
    {
        PropertyList = new ObservableCollection<Property>(from property in entities.Properties.Include("Images") select property);        

        //Sort the list (based on previous session stored in database)
        var sortList = PropertyList.OrderBy(x => x.Sort).ToList();
        PropertyList.Clear();
        sortList.ForEach(PropertyList.Add);

        propertyView = CollectionViewSource.GetDefaultView(PropertyList);         
        if (propertyView != null) propertyView.CurrentChanged += new System.EventHandler(propertyView_CurrentChanged);           


        public const string PropertiesPropertyName = "PropertyList";
    private ObservableCollection<Property> _PropertyList = null;

    public ObservableCollection<Property> PropertyList
    {
        get
        {
            return _PropertyList;
        }

        set
        {
            if (_PropertyList == value)
            {
                return;
            }

            var oldValue = _PropertyList;
            _PropertyList = value;

            // Update bindings, no broadcast
            RaisePropertyChanged(PropertiesPropertyName);
        }
    }    
  • 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-06-02T13:08:08+00:00Added an answer on June 2, 2026 at 1:08 pm

    Ended up solving the issue by following the answer provided on this question:

    Listview to display ObservableSelection

    I created an observablecollection for the images and then created a new method images_Update() , which is called everytime the current item of the view (of the properties observable collection) changes. I also slotted it in at the bottom of the AddImage() and DeleteImage() method to ensure that when they are called the list is updated.

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

Sidebar

Related Questions

I have data stored in a SQL database that I'm attempting to read into
So lets say I have an object that it stored in a Database: com.test.dummy.Cat
I have a business object collection (representing data from the database) that inherits from
I have a list of ordered objects stored in the database and accessed through
I have an assortment of database objects (tables, functions, views, stored procedures) each scripted
I have a MySQL database that contains geo-tagged objects. The objects are tagged by
I have a stored procedure in my database that takes a table value parameter,
I have an array of php objects that I want to store into a
When users log into our site we retrieve an object from our database that
I have a database where I store objects. I have the following (simplified) schema

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.