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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T09:34:40+00:00 2026-05-26T09:34:40+00:00

I have a listbox to which I’m binding HistoryItems , where HistoryItems is a

  • 0

I have a listbox to which I’m binding HistoryItems , where HistoryItems is a ObservableCollection of History.
Here is the listbox declaration :

 <ListBox x:Name="RecentListBox" SelectionChanged="RecentListBox_SelectionChanged"   ItemsSource="{Binding HistoryItems,Converter={StaticResource HistoryValueConverter} }" ItemsPanel="{StaticResource ItemsPanelTemplate1_Wrap}" ItemTemplate="{StaticResource RecentViewModelTemplate}">

Here is the History class :

public class History : INotifyPropertyChanged
    {
        public History() { }

        int _id;
        string _date;
        string _url;
        string _name;

        public History(int id, string date,string url,string name)
        {
            this.id = id;
            this.date = date;
            this.url = url;
            this.name = name;
        }

        public int id
        {
            get
            {
                return _id;
            }
            set
            {
                if (value != _id)
                {
                    _id = value;
                    NotifyPropertyChanged("id");
                }
            }
        }
        public string date
        {
            get
            {
                return _date;
            }
            set
            {
                if (!value.Equals(_date))
                {
                    _date = value;
                    NotifyPropertyChanged("string");
                }
            }
        }

        public string url
        {
            get
            {
                return _url;
            }
            set
            {
                if (!value.Equals(_url))
                {
                    _url = value;
                    NotifyPropertyChanged("url");
                }
            }
        }

        public string name
        {
            get
            {
                return _name;
            }
            set
            {
                if (!value.Equals(_name))
                {
                    _name = value;
                    NotifyPropertyChanged("name");
                }
            }
        }

        public event PropertyChangedEventHandler PropertyChanged;
        private void NotifyPropertyChanged(String propertyName)
        {
            PropertyChangedEventHandler handler = PropertyChanged;
            if (null != handler)
            {
              //  App.viewModel.HistoryItems = (App.Current as App).dataHandler.retrieveHistory_DB();
                handler(this, new PropertyChangedEventArgs(propertyName));
            }
        }
    }

When I start the app the list gets populated, but after I do some modifs in some pivot children, and go back to the main panorama view, I try to update the HistoryItems in OnNavigatedTo :

 App.ViewModel.HistoryItems = (App.Current as App).dataHandler.retrieveHistory_DB();

but the listbox doesn’t get updated (and the function returns the correct data). What could the problem be? History is INotifyPropertyChanged and the HistoryItems is a ObservableCollection<History> so there should be no problem.. What is causing the list to not update?

  • 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-26T09:34:41+00:00Added an answer on May 26, 2026 at 9:34 am

    Since you are replacing HistoryItems when you refresh it doesn’t matter that it’s an ObservableCollection.

    You can either clear the HistoryItems and then add the new items when you refresh. Or the ViewModel should implement INotifyPropertyChanged and the HistoryItems setter should raise the event.

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

Sidebar

Related Questions

[Original] I have a ListBox which has its ItemsSource (this is done in the
I have a ListBox which is databound to an ObservableCollection and has a complex
I have a ListBox which is bound to ObservableCollection of LogMessages. public ObservableCollection<LogMessage> LogMessages
I have a ListBox control which is binded to a ObservableCollection . My XAML
I have a ListBox which hold a set of objects (linked via ItemsSource bind
I have a ListBox which I bind to an ObservableCollection<Series> in the view model.
I have WPF ListBox which is bound to a ObservableCollection, when the collection changes,
I have this ListBox which is bound to an ObservableCollection. Each object in the
I have a WPF ListBox which contains a CheckBox as follow: <ListBox x:Name=MyListBox Grid.Row=1
I have a ListBox which is bound to my custom class ObservableCollection<FieldPropertyItem> _fieldOrderCollection`; internal

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.