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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T22:25:29+00:00 2026-05-26T22:25:29+00:00

My WPF application should receive data from pipe via WCF: I’m new to MVVM

  • 0

My WPF application should receive data from pipe via WCF:
I’m new to MVVM and I can’t understand where to put some stuff. It’s clear for me what is View but it not clear what is ViewModel and especially what is Model in my case (in case when WCF involved) The questions are:

  • what is Model? Do I need special class to represent model? Or Model is WCF server application? What is valid worflow “WCF Server application —-named pipe—–> ViewModel <–Data binding–> View” or “WCF Server application —-named pipe—–> Model<—>ViewModel <–Data binding–> View”
  • how to refactor code below? where to put all this initialization? to ViewModel? to Model class (if I need it), to special “initialization” class?

    public MainWindow()
    {
    ChannelFactory<IManagementConsole> pipeFactory =
    new ChannelFactory<IManagementConsole>(
        new NetNamedPipeBinding(),
        new EndpointAddress(
            "net.pipe://localhost/PipeMBClientManagementConsole"));
    
        IManagementConsole pipeProxy =
          pipeFactory.CreateChannel();
    
        List<ConsoleData> datas = new List<ConsoleData>();
        foreach (StrategyDescriptor sd in pipeProxy.GetStrategies())
        {
            datas.Add(pipeProxy.GetData(sd.Id));
        }
        this.DataContext = datas;
    }
    

Can I assume that this is my MVVM Model? :

[ServiceContract]
public interface IManagementConsole
{
    [OperationContract]
    ConsoleData GetData(int strategyId);

    [OperationContract]
    List<StrategyDescriptor> GetStrategies();
}
  • 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-26T22:25:29+00:00Added an answer on May 26, 2026 at 10:25 pm

    A Model is a class that describes data from backend data source. They can be the actual classes from the source (like EF or WCF Proxies) or they can be simple DTOs. It really depends on your preference.

    A ViewModel is a class that describes data for display in the View. Frequently, but not necessarily, the data comes from Model classes.

    The ViewModel is responsible for managing the Model classes: exposing their information to the View and doing something with/to them based on input from the View. That being said, I prefer not to see the actual communications work in the ViewModel. Instead, I abstract the communications into another layer (I call mine the Service layer, but that can be confusing in this context).

    In essence, I have the ViewModel make requests to the Service layer which communicates with the backend to retrieve/create Model objects that are then returned to the ViewModel. This gets complicated if the service calls are Asynchronous but can still be done.

    For a simple example of this, download the code sample from practicalmvvm.com.

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

Sidebar

Related Questions

I’m building a WPF application using MVVM pattern (both are new technologies for me).
When using the MVVM pattern to structure your WPF application you should get all
I'm working on a WPF application which should be utilizable with two monitors. In
What kind of skills should a WPF developer know to create MVVM applications? Things
My WPF application is structured using the MVVM pattern. The ViewModels will communicate asynchronously
A WPF application should be a visualizer front-end for a ERP database (in fact
In my WPF application data model I have multiple classes representing data for interaction
My application is fed data from an external device. After each data point, there
I am currently working on a WPF application that processes data in a database
I'm a developer of WPF application and I should to apply a design of

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.