WPF Interview Questions
There is given frequently asked WPF interview questions and answers that has been asked in many companies. Let's see the list of top WPF interview questions.
1) What is WPF?
WPF stands for Window Presentation Framework. It is the latest presentation API by Microsoft Windows. WPF is a 2D and 3D graphics engine.
2) What are the capabilities of WPF?
WPF has following capabilities:
3) What are resources in WPF?
In WPF, resources are used to provide a simple way to reuse commonly defined objects and values. They also facilitate you to set the properties of multiple controls at a time. For example, you can set the background property on several elements in a WPF application using a single resource.
4) What is XAML?
XAML is a declarative XML based language. It facilitates you to define objects and properties in XML. Its documents are loaded by XAML parser.
5) What is the use of XAML?
XAML is used to describe the objects, properties and their relation in between them. It makes you able to create any type of objects i.e. graphical and non-graphical.
6) What is a routed event?
There are many types of elements in a typical WPF application and these elements are set in an element tree relationship. A routed event is a type of event that is used to invoke handlers on multiple listeners in an element tree.
7) How many types of documents are supported by WPF?
Two types of documents are supported by WPF.
Flow format document: Flow format document is used to alter the content to fit on the screen size.
Fixed format document: Fixed format document present content irrespective of the screen size.
8) What do you know by content alignment in WPF?
There are two types of content alignment in WPF:
These both properties are defined in the System.Windows.Controls.Control class which is the parent class of all controls in WPF.
By default the vertical and horizontal alignment of content of a TextBox is left and top and button is center.
9) Write down the syntax for resources in WPF.
elementName: Name of the element that uses the resource.
propertyName: Name of the property that takes its value from the resource.
markupExtension: Define type of resource.
keyName: key name of the resource, which is unique string to identify the resource.
10) How many types of resources available in WPF?
There are mainly two types of resources in WPF:
11) Which namespace is required for working with 3D?
System.Windows.Media.Medi3D is the namespace required for working with 3D.
12) Can we say that WPF is the replacement of DirectX?
No, WPF cannot replace DirectX, because WPF is not enough efficient to create games with stunning graphics. WPF is only meant to be a replacement of windows forms, not DirectX.
13) What are the dependency properties?
Dependency properties are the type of properties which belong to a specific class but can be used for another class.
14) What is CLR?
CLR stands for Common Language Runtime. It is a run time environment for .NET
15) What are the freezable objects in WPF?
An object which is unchangeable is known as freezable object. The freezable objects perform better and also safer if they are required to be shared between threads.
16) What is value converter in WPF?
A value converter acts as a bridge between a target and a source and it is necessary when a target is bound with one source, for instance you have a text box and a button control. You want to enable or disable the button control when the text of the text box is filled or null. In this case you need to convert the string data to Boolean. This is possible using a Value Converter. To implement Value Converters, there is the requirement to inherit from I Value Converter in the System.Windows.Data namespace and implement the two methods Convert and Convert Back.
17) What is the difference between Silverlight and WPF browser application?
These are the main differences between the Silverlight and WPF browser application:
18) Which tool is required to sketch a mock of your WPF application?
The SketchFlow tool is used to sketch a mock of WPF application.
19) What are the different types of layout controls?
Following are the different types of layout controls:
20) What is PRISM?
PRISM is a framework that is used for creating complex applications for WPF, Silverlight or Window phones. It uses MVVM, IC, Command Pattern, DI and separation of concerns to get loose coupling.
21) What is CustomControl?
CustomControl is used to expand the functions of existing controls. It contains a default style in theme and code file.
22) What is the use of custom control?
Custom control is the best way to make a control library. It can also be styled or template.
23) What is the Path animation in WPF?
Path animation is a different type of animation. In this animation, the animated objects follow a path set by the path geometry.
24) What is the meaning of BAML in WPF?
BAML stands for Binary Application Markup Language. It is a type of XAML that has been tokenized, parsed, and changed into binary form.
25) What is the difference between XAML and BAML?
The only difference between XAML and BAML is that BAML is a compressed declarative language which is loaded and parsed quicker than XAML.
26) What is the difference between Page control and Window Control in WPF?
27) What is the parent class of control class of WPF?
The control class of WPF is derived from FrameworkElement.
28) What is the difference between DynamicResource and StaticResource?
29) Is MDI supported in WPF?
MDI is not supported in WPF. The same functionality of MDI can be given by UserControl.
30) What is serialization?
Serialization is a process of converting the state of an object to stream of bytes.
31) What is MVVM?
MVVM is stand for Model View ViewModel. It 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. Loose coupling can be attained by using MVVM.
32) When did MVVM introduced?
MVVM was introduced by John Gossman in 2005. It was introduced specifically to use with WPF as a concrete application of Martin Fowler's broader Presentation Model pattern.
33) What are the advantages of MVVM?
MVVM has the following advantages:
34) What are the most important features of MVVM?
A list of most important features of MVVM:
35) How is MVVM different from MVC?
MVC stands for Model-View Controller and.MVVM stands for Model-View ViewModel.
In MVVM, View Model is used instead of a controller. This View Model is present beneath the UI layer. It reveals the command objects and data that the view requires. It acts like a container object from which view gets its actions and data.