WPF Interview Questions & Answers

Ratings:
(4)
Views:0
Banner-Img
  • Share this blog:

WPF Interview Questions

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?

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.

You liked the article?

Like : 0

Vote for difficulty

Current difficulty (Avg): Medium

Recommended Courses

1/15

About Author
Authorlogo
Name
TekSlate
Author Bio

TekSlate is the best online training provider in delivering world-class IT skills to individuals and corporates from all parts of the globe. We are proven experts in accumulating every need of an IT skills upgrade aspirant and have delivered excellent services. We aim to bring you all the essentials to learn and master new technologies in the market with our articles, blogs, and videos. Build your career success with us, enhancing most in-demand skills in the market.


Stay Updated


Get stories of change makers and innovators from the startup ecosystem in your inbox