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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T04:52:17+00:00 2026-05-27T04:52:17+00:00

I have build a WCF template service which talks (original: discuss) with my EF

  • 0

I have build a WCF template service which talks (original: discuss) with my EF connected to my database. Then I have my main aplication which a simple WPF implementing MVVM light.
My main application is referecing my WCF service and has created the config file automatically.

In my ViewModel constructor I am calling my WCF service in order to get the collecton of data which will be bound to the view.

Toruble is that doing that, the Datacontext which is initialised to the ViewModelLocator.MainStatic is generating an error “Cannot create instance of “ViewModelLocator”.

If I remove the service call from the viewmodel, error desapperas but could not get data of course.

Any idea how to implement service call in order to populate collection in a MVVM light tool kit ?
Any sample you have to go throuh ?

Unfortunatly there is no such exemple around. and could get it

Thanks for you help
serge

  • 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-27T04:52:18+00:00Added an answer on May 27, 2026 at 4:52 am

    In general I would assume that it is because you making the call at design time. Use the IsInDesignModeStatic in your view model to distinguish run time code and design time code. In the designtime code I would add some data manually to make it easier for yo to design your view..
    See also this discussion for further guidance.

    Sample in Daniel’s answer.

    And this post the point that calls to Databases don’t work either in design mode.

    Edit

    Laurent also is bloging about this topic.

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

Sidebar

Related Questions

I have a (very) simple WCF written in VB which I can build and
I have build an APi which is a WCF Service. In the web.config for
I have a web site and build a wcf service in it. I can
I have a WCF-REST service with one method which returns a string: [ServiceContract] public
I have written a WCF service with the REST template that has the defaultOutgoingResponseFormat
I have some collegues who have build a WCF Service. Their security settings are
I have a REST Service built with WCF Rest Service Template. I am curious
I have develop one simple database application build using SilverLight5.0 + Entity Framework +
I have created a wcf service which is deployed via a managed windows service.
I have a WCF service library built using c# and system.data.sqlite.dll x64. The build

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.