Wednesday, 17 April 2013

Commonly Asked WPF Interview Questions and Answers (Part 1)

Commonly Asked WPF Interview Questions and Answers (Part 1)

In this aritcle on "Commonly Asked WPF Interview Questions and Answers (Part 1)", I will focus on very simple and basic WPF interview questions which a WPF developer should know. These WPF interview questions are based on general introduction of WPF, XAML, MVVM Pattern, Comparison of WPF and Silverlight, Layout Panels in WPF and WPF UserControls / CustomControls.

1. What is WPF?

The Windows Presentation Foundation is Microsofts next generation UI framework to create applications with a rich user experience. It is part of the .NET framework 3.0 and higher.

WPF combines application UIs, 2D graphics, 3D graphics, documents and multimedia into one single framework. Its vector based rendering engine uses hardware acceleration of modern graphic cards. This makes the UI faster, scalable and resolution independent.

2. What is XAML?

Extensible Application Markup Language, or XAML (pronounced "zammel"), is an XML-based markup language developed by Microsoft. XAML is the language behind the visual presentation of an application that you develop in Microsoft Expression Blend, just as HTML is the language behind the visual presentation of a Web page. Creating an application in Expression Blend means writing XAML code, either by hand or visually by working in the Design view of Expression Blend.

3. What is MVVM Pattren?

Model-View-ViewModel (MVVM) pattern splits the User Interface code into 3 conceptual parts - Model, View and ViewModel.

Model is a set of classes representing the data coming from the services or the database.

View is the code corresponding to the visual representation of the data the way it is seen and interacted with by the user.

ViewModel serves as the glue between the View and the Model. It wraps the data from the Model and makes it friendly for being presented and modified by the view. ViewModel also controls the View's interactions with the rest of the application

4. What is the difference between MVVM and MVC patterns?

MVVM Model-View ViewModel is similar to MVC, Model-View Controller.

The controller is replaced with a View Model. The View Model sits below the UI layer. The View Model exposes the data and command objects that the view needs. You could think of this as a container object that view goes to to get its data and actions from. The View Model pulls its data from the model.

5. What are the similarities and differences between WPF and Silverlight?

Similarities between Silverlight and WPF

1. Silverlight and WPF both use XAML.
2. Silverlight and WPF share same syntax, code and libraries.

Difference between WPF and Silverlight

1. WPF  is tool for writing full-featured desktop applications that run on Windows while Silverlight is for web application.

2. WPF competes with Windows Forms only for writing desktop applications while Silverlight competes with Flash, Java web apps etc.

6. What is the need of layout panels in WPF?

Layout of controls is critical to an applications usability. Arranging controls based on fixed pixel coordinates may work for an limited enviroment, but as soon as you want to use it on different screen resolutions or with different font sizes it will fail. WPF provides a rich set built-in layout panels that help you to avoid the common pitfalls.

7. What are the different types of layout panels in WPF?

There are mainly 5 types of layout panels in WPF. These are:

Grid Panel
Stack Panel
Dock Panel
Wrap Panel
Canvas Panel

8. How to create a User Control and then how to use it in a WPF application?

User Controls are commonly used in a WPF application. So you should know this concept and you should be able to write a simple program to show how usercontrols are created and used in WPF application. I am sharing a link which created and uses usercontrol in very simple manner. Have a look:

9. What is the difference between UserControl and CustomControl in WPF?

UserControl (Composition)

Composes multiple existing controls into a reusable "group"
Consists of a XAML and a code behind file
Cannot be styled/templated
Derives from UserControl

CustomControl (Extending an existing control)

Extends an existing control with additional features
Consists of a code file and a default style in Themes/Generic.xaml
Can be styled/templated
The best approach to build a control library

Update: For Part 2 of this post, click here.


  1. i wanna some more ,,,,,,,,,,,,,,,,,,

  2. This comment has been removed by a blog administrator.

  3. This comment has been removed by a blog administrator.

  4. This comment has been removed by a blog administrator.

  5. rofl this article sure sucked the muslim unit incher dick
    who is the dumb ahole who posted this piece of worthless crapola

  6. To enjoy good health, to bring true happiness to one's family, to bring peace to all, one must first discipline and control one's own mind. If a man can control his mind he can find the way to Enlightenment, and all wisdom and virtue will naturally come to him

  7. I found lots of interesting information here.Great work. The post was professionally written and I feel like the author has extensive knowledge in this subject. Nice post.
    pacman |happy wheels |my little pony games | unblocked games

  8. Really like the dear information you offer in your articles. I’m able to bookmark your site and show the kids check out up here generally.
    messenger indir | messenger download | messenger indir | messenger indir | messenger | messenger indir

  9. Nice post. I was convinced by your arguments. Surely you must have extensive knowledge and understanding very much. I admire you, write more. descargar facebook , whatsapp gratis , whatsapp messenger , mobogenie , mobogenie , baixar facebook , baixar facebook


  10. who like Inside Out Games by far the most, and found out, that eleven to 17 ladies are more attuned to expressions and thoughts than Other individuals. Here is the main reason, why the most crucial character In this particular cartoon movie is tiny, eleven a long time aged, Woman. When very little girls see, that there's a girl while in the film, that has a similar age, the like it A growing number of. So, we expect, that Within Out Game titles will probably be appreciated highly! The funds of Inside of Out was $one hundred seventy five million, but authors commercialized a great deal more, than they had put in! They have acquired $ million from revenue in all around the world. From that we will have an understanding of, that this movie appeals to each persons, it does not make a difference he / she will be Woman, or boy, teen or mature. Those individuals like Inside of Out Games also, not surprisingly.
    INSIDE OUT GAMES ONLINE | FROZEN DOUBLE TROUBLE ONLINE | Zootopia Dash ONLINE | ZOOTOPIA GAMES ONLINE | Inside Out Games | Inside Out Thought Bubbles | Elsa Frozen | zootopia | zootopia dash