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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T11:11:02+00:00 2026-06-17T11:11:02+00:00

In my APP I’m using an API of a software that my tool is

  • 0

In my APP I’m using an API of a software that my tool is managing. I’ve DAL that contain 16 classes, 3 of them are singletons. I’ve some logic in the .cs files and XAML‘s off course.

My question is, I see a lot of comments that an app written in WPF should use MVVM, and this will make the code more usable and readable, can I transform my code to be MVVM? what it the actual meaning of MVVM (not Wikipedia or manual definition)?

I also use SQL queries and I read a paper about EF (Entity Framework), can MVVM and EF coexist together in the same project?

  • 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-17T11:11:04+00:00Added an answer on June 17, 2026 at 11:11 am

    The actual meaning of MVVM is: UI is not Data. Data is Data, UI is UI.

    This means that you should not develop the application in a way that the program logic (often called business logic) is tightly coupled or dependent on the state of UI components, but instead make it dependent on the state of data items (be it the Model, or the View Model).

    For example, in other frameworks (such as winforms), if you have a screen that contains a textbox, and a button, you usually add a click event handler to the button and then read the text from the textbox. in MVVM, the Text property of the TextBox should be bound to a string property in the ViewModel, and the button should be bound to a Command in the ViewModel as well.

    This allows for an abstraction of the UI (which is the ViewModel), so that, as I said before, your application logic can be dependent on not the UI but an abstraction of it.

    This allows for a huge amount of scalability in the UI and the logic, and also allows for the testability of several aspects of UI behavior because a big portion of the UI behavior is defined in the ViewModel.

    There are other aspects of MVVM as well, but the main realization is that.

    Edit:

    I will add a concrete example of this for completeness of the answer:

    1 – Non MVVM WPF:

    XAML:

    <StackPanel>
       <TextBox x:Name="txtLastName"/>
       <Button Content="Click Me" Click="Button_Click"/>
    </StackPanel>
    

    Code behind:

    private void Button_Click(object sender, EventArgs e)
    {
        //Assuming this is the code behind the window that contains the above XAML.
        var lastname = this.txtLastName.Text; 
    
        //Here you do some actions with the data obtained from the textbox
    }
    

    2 – MVVM WPF:

    XAML:

    <StackPanel>
       <StackPanel.DataContext>
           <my:MyViewModel/>
       </StackPanel.DataContext>
       <TextBox Text="{Binding LastName}"/>
       <Button Content="Click Me" Command="{Binding MyCommand}"/>
    </StackPanel>
    

    ViewModel:

    public class MyViewModel
    {
        public string LastName { get; set; }
    
        public Command MyCommand { get; set; }
    
        public MyViewModel()
        {
            // The command receives an action on the constructor,
            // which is the action to execute when the command is invoked.
            MyCommand = new Command(ExecuteMyCommand); 
        }
    
        private void ExecuteMyCommand()
        {
            //Only for illustration purposes, not really needed.
            var lastname = this.LastName; 
    
            //Here you do some actions with the data obtained from the textbox
        }
    }
    

    As you can see in the above example, the ViewModel contains no reference at all to the View. Thus, the View could be anything, as long as the {Bindings} are kept in place.

    The glue that magically makes them work together is the DataContext Property of WPF UI Elements, which is the object that all bindings will be resolved against.

    There are other things, such as the Property Change Notification in the ViewModel to enable two-way bindings, but that is out of the scope of this answer.

    Also keep in mind that MVVM is a design pattern, whereas WPF is a framework. MVVM is also being currently applied in other technologies (there is currently a lot of buzz about MVVM for the web, with JavaScript and stuff like that)

    I suggest you read the books mentioned in other answers as well as this Tutorial for more WPF-specific aspects.

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

Sidebar

Related Questions

My app is saving some images on the SD Card, in the AppImages directory
My app's requirement is that it needs to take a picture and then divide
App Store We have been developing an app for quite some time now for
app/config/routing.yml NelmioApiDocBundle: resource: @NelmioApiDocBundle/Resources/config/routing.yml prefix: /api/doc vendor/nelmio/api-doc-bundle/Nelmio/ApiDocBundle/Resources/config/routing.yml nelmio_api_doc_index: pattern: / defaults: { _controller: NelmioApiDocBundle:ApiDoc:index
We're building an app, our first using Rails 3, and we're having to build
@app.route(/<requested_username>/<requested_team>, methods=['GET', 'POST']) ^How do I make this so that no matter what is
app.use(express.compiler({ src: __dirname + '/public', enable: ['less'] })); That's the line in my app.js
App store approval guideline says that Apps that send Push Notifications without first obtaining
app.get(/:name?/:group?, function(req, res){... is matching files that are in my public directory. So if
My app written in c# (winforms) launches a third party using Process.start(). After launch,

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.