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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T07:22:09+00:00 2026-05-20T07:22:09+00:00

I am using Silverlight 4 and MVVM pattern for my application. I have a

  • 0

I am using Silverlight 4 and MVVM pattern for my application. I have a listbox that is bound to one page say one.xaml and it’s viewmodel is oneviewmodel.cs. This is the page where i load my albums collection. I have a button on that page which popups a page to add a new album. Say that page is two.xaml and it’s viewmodel is twoViewModel.cs. On this page i call ria services :-

context.albums.add(somealbum);

and submit the changes.The album gets added and i can see the record in sql server. However when the popup gets closed my listbox still shows the stale data. Do i need to again make a request to server to load the fresh entity just added? Thus, essentially i have to use messaging pattern and request oneviewmodel.cs to load the entities again. Is this correct way of doing?

This is my method of loading album entities :-

  var qry = AlbumContext.GetAlbumsQuery(_profile.UserId);
            AlbumContext.Load<Album>(qry, new Action<System.ServiceModel.DomainServices.Client.LoadOperation<Album>>(albums => {

                if (GetAlbumsComplete != null)
                {

                    if (albums.Error == null)
                    {
                        GetAlbumsComplete(this, new EntityResultArgs<Album>(albums.Entities));
                    }
                    else
                    {
                        GetAlbumsComplete(this,new EntityResultArgs<Album>(albums.Error));
                    }
                }

            }), null);

This is using the same pattern and classes as Shawn Wildermuth.

Thanks in advance 🙂

  • 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-20T07:22:10+00:00Added an answer on May 20, 2026 at 7:22 am

    You do not need to load everything from the server again, but you need to add the new album to your ObservableCollection. So far you only added it to the DomainContext.
    You could do one of the following two options:

    1) Add the new album directly to the collection with

    collection.Add(somealbum);
    

    or

    2) I assume that you fill the ObservableCollection in GetAlbumsComplete(). Just execute that part again, so that the ObservableCollection is filled with the content of your DomainContext.Albums.

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

Sidebar

Related Questions

We have application have been written in Silverlight using MVVM pattern. We need to
I have a silverlight bing map application. I am using the MVVM pattern with
I have a Silverlight app that is using the MVVM pattern. I have a
I'm working on a Silverlight app using the MVVM pattern. My ViewModel currently consists
I'm writing a Silverlight app using the MVVM pattern. I have a main view
I'm using a Silverlight 4.0 project that utilizes MVVM and we have a combobox
I am building a silverlight application using MVVM pattern but I don't understand what
I'm trying to create an silverlight application using the MVVM design pattern. It's a
I have a silverlight wp7 application and I'm applying the MVVM pattern. The model
I've started using databinding with MVVM pattern in Silverlight. There's one problem for me.

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.