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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T10:23:32+00:00 2026-05-12T10:23:32+00:00

Background: I have a List<T> in my ViewModel defined as… private List<FooBar> _fooBars; public

  • 0

Background:

I have a List<T> in my ViewModel defined as…

private List<FooBar> _fooBars;

public List<FooBar> FooBars
{
    get { return _fooBars; }
    set
    {
        if (value == _fooBars) return;
        _fooBars = value;
        OnPropertyChanged("FooBars");
    }
}

FooBar is defined as…

public class FooBar
{
    public string FooBarProperty { get; set; }
    // more properties here
}

Meanwhile, I have a GridView that binds to this list.

<ListView
    ItemsSource="{Binding FooBars}">
    <ListView.View>
        <GridView
            <GridViewColumn
                Header="Foo Bar Prop"
                DisplayMemberBinding={Binding FooBarProperty} />
            <!--more columns here-->
        </GridView>
    </ListView.View>
</ListView>

I run my app and all this works great. My FooBarProperties fill as expected.

The Problem:

In response to some user action. I edit one of the FooBar objects in FooBars, and call OnPropertyChanged() to let WPF know I want the bindings to update.

FooBars[2].FooBarProperty = "Some new text here";
OnProperChanged("FooBars"); // WPF is not listening to this :(

Only one problem: this completely doesn’t work. The GridView never udpates.

A Workaround:

After much head scratching (and table banging and swearing), I came up with this replacement for the above:

FooBars[2].FooBarProperty = "Some new text here";
FooBars = FooBars.Select(fb => fb).ToList(); // this works but why is it necessary?

Works like a charm, but why do I need to do this?

NOTE: I tried switching from List<FooBar> to ObservableCollection<FooBar>, but that made absolutely no difference.

My Questions:

Very simply, why do I need this crazy code that basically copies the list into itself to get my bindings to update?

Is there a better way to force an update?

Thanks.

EDIT — The Final Solution:

Thanks to @Botz3000’s answer below, I switched FooBars back to ObservableCollection<FooBar>, and I modified FooBar so it implements INotifyChanged. Everything works as it’s supposed to and no weird list copying required.

  • 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-12T10:23:33+00:00Added an answer on May 12, 2026 at 10:23 am

    If you are not changing the object that is stored in the ObservableCollection itself, but rather a property of it, then the CollectionChanged event won’t be triggered.

    Your FooBarProperty needs a PropertyChanged("FooBarProperty"), too. Since the list items bind to this property, they’ll need notifications for that.

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

Sidebar

Related Questions

No related questions found

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.