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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T07:28:38+00:00 2026-06-03T07:28:38+00:00

In Windows Phone I populate my Pivot control with an ObservableCollection model that gets

  • 0

In Windows Phone I populate my Pivot control with an ObservableCollection model that gets its data from an SQL database with LINQ. This works very well on the initial setup.

But when I’ve done some changes to the DB and then I want to run the LINQ query again to reflect the changes to the UI (and the ObservableColletion), I’ve noticed that the ObservableCollection does not get the new values as I would expect from the LINQ query.

private ObservableCollection<ComicItem> m_showingComicsListModel;
public ObservableCollection<ComicItem> ShowingComicsListModel
{
...
}

...

var comicsSelectedInDB = from ComicItem item in comicListDb.Items
                         where item.IsShowing == true
                         select item;

m_showingComicsListModel = new ObservableCollection<ComicItem>(comicsSelectedInDB );

So when the showingComicsListModel is evaluated the first time, it populates the model properly. But after I’ve done some changes to the DB and run this code a second time, the ShowingComicsListModel has not changed and the setter is not called.

Any hints on what is the proper way to update an ObservableCollection with LINQ?

  • 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-03T07:28:39+00:00Added an answer on June 3, 2026 at 7:28 am

    You have two ways to resolve your problem.

    First option is to Clear the existing ObservableCollection and add the result of the linq query to the Collection

    var comicsSelectedInDB = from ComicItem item in comicListDb.Items
                         where item.IsShowing == true
                         select item;
    
    m_showingComicsListModel.Clear();
    
    foreach(var comic in comicsSelectedInDB) {
      m_showingComicsListModel.Add(comic);
    }
    

    or

    Second option is to raise the PropertyChangedEvent for the property ShowingComicsListModel to notify the UI that the bound property has changed. This solution requires that the class implements the INotifyPropertyChanged interface.

    private ObservableCollection<ComicItem> m_showingComicsListModel;
    public ObservableCollection<ComicItem> ShowingComicsListModel
    {
      get{ return m_showingComicsListModel;}
      set{
           m_showingComicsListModel = value;
           RaisePropertyChanged("ShowingComicsListModel");
      }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In windows phone 7.5 data recepie cookbook author claims that Linq to XML is
On windows phone 7 pivot control template project, the pivot control page doesn't remember
Windows Phone 7.1: How to add/delete items from LongListSelector control? I am using a
I'm making a Windows Phone 7 app with a few different pivot pages. I
I am developing a Windows Phone Application and from this application I am accessing
I've got a Windows Phone 7 Silverlight app that I am trying to use
I am developing Windows Phone 7 application in which I send encrypted data to
I'm developing an app for Windows Phone 7 that populates a WrapPanel with a
Windows Phone 7.1/7.5/Mango Silverlight App. Coming from here: Need clarification on using audio on
Windows Phone 7.5 app. Designer has created Home.xaml in Blend that has 3 images(menu

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.