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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T05:19:30+00:00 2026-05-24T05:19:30+00:00

When writing a WPF application using MVVM, I want to use a WCF service,

  • 0

When writing a WPF application using MVVM, I want to use a WCF service, with methods on it to provide the relevant data from the applications database.

As an example, if my system has a list of Tasks, they are stored in a SQL database. I can put a method on the Web Service to retrieve all tasks from the database.

I can call this method from a ViewModel and store the results in a

public List<Task> Tasks { get; set; }

Then I would bind a control on my View to this property.

I already have something in place for my View to update, when the Tasks property changed (I didn’t put it above to keep the example simple).

My question is, when a new task is added to the database by somebody else, how do I update the Tasks property on the ViewModel?

Do I need to poll the database every x minutes to look for new tasks (Via a method on the WCF service)?

Or can I somehow do something that will update the Tasks property when tasks are added to the database?

  • 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-24T05:19:31+00:00Added an answer on May 24, 2026 at 5:19 am

    You would need to perform some kind of polling to make this work. Changes made to data in your ViewModel are updated directly (via your bindings) because all the changes occur in the WPF app’s memory. Changes to the database, though, will only be known to the database.

    You might want to add a method to your WCF service that takes a DateTime which will return all tasks added since a given time. Then, call that method from your ViewModel at a frequency that makes sense for your usage scenarios and expected data update rates. At that point, any news tasks added should be reflected in your View.

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

Sidebar

Related Questions

I'm writing an application in WPF using the MVVM-pattern and will really often use
I am writing a WPF application and I want to use Data Annotations to
I'm writing a WPF application using the MVVM pattern, based on the following article:
I'm writing a WPF test application against a WCF REST service running on Azure
I'm writing a WPF application using a MVVM pattern and using Prism in selected
I'm writing an application in WPF using the MVVM pattern. In my application I've
I am writing an WPF MVVM application using Prism. A couple days ago I
I'm writing an application using WPF MVVM. I have a view model with property
I'm working on writing a small application using the WPF MediaKit , and I
I'm writing a WPF application with C# as the code behind and I want

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.