Click below for Step by Step and Interview Q & A (dotnetinter) wrote,
Click below for Step by Step and Interview Q & A
dotnetinter

What is MVVM? (WPF MVVM Interview questions)

In case you are new to WPF we would strongly suggest to see this video created by www.questpond.com which explains the what is WPF and how they differ from old windows form programming



MVVM is an architecture pattern where we divide the project in to three logical layers and every layer has its own responsibility.

DAL 3

Below are the three logical layers with explanation what they do:-

  • View: - This layer handles responsibility of taking inputs from end user, positioning of controls, look and feel, design, visuals, colors etc.

  • Model: - This layer represents your middle layer objects like customer, supplier etc. It handles business logic and interaction with data access layer.

  • View Model: - This layer is the bridge between model and view.  It handles connection logic   , data transformation logic and action mapping between model and view. For example it will have following types of logics as shown  below :-

             o       Replicating and propagating data between views and models. When someone enters data in to UI or the
                      model gets updated this layer will ensure that the propagation of data happens between these entities.
             o       Handling data transformation from view to model and vice versa. For example you have a model which
                      has gender property with data as “M” for male and “F” for female. But on the View or UI you would like
                      to display as a check box with true and false. This transformation logic is written in the view model
                      class.

View model also map UI actions to methods. For example you have “btn_Add” click event and when any one clicks on this button you would like to invoke “Customer.Add()” method from the customer class. This connection code is again a part if view model.

Recently one of our friends was asked to explain WPF dependency property  , below is link which explains the same in great details http://www.dotnetinterviewquestions.in/article_c-wpf-interview-questions::-what-are-dependency-properties-_142.html

Tags: csharp interview questions, it interview questions with answers, programming interview questions, wpf interview questions with answers, wpf mvvm interview questions, wpf(windows presentation foundation)
Subscribe

  • Stored Procedure in SQL Server.

    Stored Procedure in SQL Server Stored Procedure is collection of Sql code that can be saved under a name in SSMS(Sql Server Management Studio).…

  • SQL Server: - Extended Events

    What is Extended Events? SQL Server Extended Events helps the database administrator to collect the information necessary to identify performance…

  • SQL Server - Stored Procedure

    In this article we will understand what is the use and why do we need Stored Procedure. What is Stored Procedures? A stored Procedure is a set of…

  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments