WPF Interview Questions And Answers

WPF Interview Questions And Answers

What is WPF?

WPF (Windows Presentation foundation) is a graphical subsystem for displaying user interfaces, documents, images, movies etc in windows application.

 What is the need of WPF when we had windows forms? 

A – Anywhere execution ( Windows or Web)

B – Bindings ( less coding)

C – Common look and feel ( resource and styles)

D – Declarative programming (XAML)

E – Expression blend animation ( Animation ease)

F – Fast execution ( Hardware acceleration)

G – Graphic hardware independent ( resolution independent)

I would strongly suggest you to see the below videowhich explains all the above A to G points practically.

What are static and dynamic resources?

XAML is a XML file which represents your WPF UI. The whole point of creating the UI representation in XML was write once and run it anywhere. So the same XAML UI can be rendered as windows application with WPF and the same UI can be displayed on the browser using WPF browser or Silverlight application.

XAML is a XML file which represents your WPF UI. The whole point of creating the UI representation in XML was write once and run it anywhere. So the same XAML UI can be rendered as windows application with WPF and the same UI can be displayed on the browser using WPF browser or Silverlight application.

What is MVVM?

Answer: MVVM (Model View ViewModel) is a framework for making applications in WPF. MVVM is the same as the MVC framework. It is a 3-tier architecture plus one more layer. We can do loose coupling using MVVM.

MVVM was introduced by John Gossman in 2005 specifically for use with WPF as a concrete application of Martin Fowler’s broader Presentation Model pattern. The implementation of an application, based on the MVVM patterns, uses various platform capabilities that are available in some form for WPF, Silverlight Desktop/web, and on Windows. Many commercial applications, including Microsoft Expression products, were built following MVVM.

Advantage of MVVM

Modularity
Test driven approach.
Separation UI and Business layer as view and view model.
Code sharing between pages and forms.
Easy to Maintain.
List of features of MVVM

It separates the business and presentation layers, like MVP and MVC.
Improve Structure/separation of concerns (View, ViewModel and Model).
Enable a better Design/Developer Workflow.
Enhance simplicity and testability.
Enabled by the robust data binding capability of XAML.
No need to use a code behind file (minimalist code-behind file).
Provides application development ability for multiple environments.
Powerful Data Binding, command, validation and much more.
The designer and developer can work together.

Describe how you would go about writing your own button style?

 Make sure the interviewee understands the following:
– How to copy the default style using Expression Blend.
– How to change the style
– How there must be a Style for each state: Enabled, Disabled, Mouseover, pushed, etc…

You need to display a list of items. Which controls are possible options? Of those, which would you use and why?

ItemsControl, ListBox, ListView, DataGrid.

– Make sure they know that ListBox and ListView can be selected while ItemsControl does not support selection.
– ListView is more feature rich, as it inherits ListBox, which inherits ItemsControl, and adds features.
– Make sure they understand what a DataGrid is and how it is different and why they would display a list in a         DataGrid.

What can you do in Expression Blend that you cannot do in Visual Studio?

Configure brushes and gradient brushes in the Properties window.
Configure Visual States.
Configure sample data.
Configure Object Timelines
Animation
Many design features…

What are common Localization/Globalization practices for Localizing/Globalizing WPF?

1) Use Resources.resx, 2) Use BAML, 3) Use a ResourceDictionary to manage localizable strings.

What are some best practices when using WPF if you plan to build a Localized/Globalized application?

Write UI in XAML
Avoid sizing and positionings, but let objects automatically flow.
Enable TextWrapping.

“At TekSlate, we are trying to create high quality tutorials and articles, if you think any information is incorrect or want to add anything to the article, please feel free to get in touch with us at info@tekslate.com, we will update the article in 24 hours.”

0 Responses on WPF Interview Questions And Answers"

    Leave a Message

    Your email address will not be published. Required fields are marked *

    Support


    Please leave a message and we'll get back to you soon.
    Three + 6