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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T15:11:33+00:00 2026-05-11T15:11:33+00:00

Is there any way, how to force ObservableCollection to fire CollectionChanged? I have a

  • 0

Is there any way, how to force ObservableCollection to fire CollectionChanged?

I have a ObservableCollection of objects ListBox item source, so every time I add/remove item to collection, ListBox changes accordingly, but when I change properties of some objects in collection, ListBox still renders the old values.

Even if I do modify some properties and then add/remove object to the collection, nothing happens, I still see old values.

Is there any other way around to do this? I found interface INotifyPropertyChanged, but I don’t know how to use it.

  • 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-11T15:11:33+00:00Added an answer on May 11, 2026 at 3:11 pm

    I agree with Matt’s comments above. Here’s a small piece of code to show how to implement the INotifyPropertyChanged.

    ===========
    Code-behind
    ===========

    using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Windows; using System.Windows.Data; using System.Windows.Documents;  namespace WpfApplication1 {        /// <summary>     /// Interaction logic for Window1.xaml     /// </summary>     public partial class Window1 : Window     {         Nicknames names;          public Window1()         {             InitializeComponent();             this.addButton.Click += addButton_Click;             this.names = new Nicknames();             dockPanel.DataContext = this.names;         }          void addButton_Click(object sender, RoutedEventArgs e)         {             this.names.Add(new Nickname(myName.Text, myNick.Text));         } } public class Nicknames : System.Collections.ObjectModel.ObservableCollection<Nickname> { }  public class Nickname : System.ComponentModel.INotifyPropertyChanged {     public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;     void Notify(string propName)     {         if (PropertyChanged != null)         {             PropertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs(propName));         }     }      string name;     public string Name     {         get { return name; }         set         {             name = value;             Notify('Name');         }     }     string nick;     public string Nick     {         get { return nick; }         set         {             nick = value;             Notify('Nick');         }     }     public Nickname() : this('name', 'nick') { }     public Nickname(string name, string nick)     {         this.name = name;         this.nick = nick;     }      public override string ToString()     {         return Name.ToString() + ' ' + Nick.ToString();     }   } } 

    XAML

    <Window x:Class='WpfApplication1.Window1' xmlns='http://schemas.microsoft.com/winfx/2006/xaml/presentation' xmlns:x='http://schemas.microsoft.com/winfx/2006/xaml' Title='Window1' Height='300' Width='300'> <Grid>     <DockPanel x:Name='dockPanel'>         <TextBlock DockPanel.Dock='Top'>         <TextBlock VerticalAlignment='Center'>Name: </TextBlock>         <TextBox Text='{Binding Path=Name}' Name='myName' />         <TextBlock VerticalAlignment='Center'>Nick: </TextBlock>         <TextBox Text='{Binding Path=Nick}' Name='myNick' />         </TextBlock>         <Button DockPanel.Dock='Bottom' x:Name='addButton'>Add</Button>         <ListBox ItemsSource='{Binding}' IsSynchronizedWithCurrentItem='True' />     </DockPanel> </Grid> 

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

Sidebar

Related Questions

Is there any way to force the Annotated Time Line graph to automatically change
Is there any way to force the persistence order of objects in JPA 2
Is there any way to force a listview control to treat all clicks as
Is there any way to force an update of software using RunOnce, without having
Is there any way to force Outlook to display HTML in the desktop alert
Is there any way to force Text-Mate to use a two-space tab instead of
Is there any way to force PHP to blow up (error, whatever) if I
Is there any way to force Visual Studio to copy selected code to the
Is there any way to force a Route to be executed, only if all
Is there any way to force a browser to refresh or empty it's cache,

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.