WPF Interview Questions and Answers

Mindmajix as a team has got enough questions from the trainees who got their WPF Training and cracked interviews at various MNCs around the world and successfully placed. From the collection of WPF Interview Questions, the following are the most common questions we got are listed to make it easy for those who are willing to crack the interview with ease. All the answers to those were written by our professional experienced trainers and are tailored to meet the concepts expected by the interviewer.

Q1). What is WPF?

Ans. Windows Presentation Foundation (WPF) is a graphical interface that furnishes the user interface for Windows-based applications. 

  • Visual State Manager
  • Touch and Manipulation
  • Graphics and Animations
  • Binding
  • XAML Browser Applications
  • Silverlight Designer

Q2). Which types of documents controls do WPF supports?

Ans. There are two types of WPF controls:

  1. Fixed Document Control - DocumentViewer
  2. Flow Document Controls - FlowDocumentReader

Q3). Which namespace is used to work with 3D in WPF?



supports 3-D presentation in WPF.

Q4). Which Class used for converting the instances of String to and fro instances of Brush?

Ans. BrushValueSerializer calss.

Q5). WPF vs Winforms / Compare WPF With Winforms


WPF WinForms
Newer Version with fine tune in current standards Older Version with more tried and tested
WPF is built from scratch and doesn't rely on standard Windows controls in almost all situations WinForms is simply a layer on top of the standard Windows controls (e.g. a TextBox)
Uses lot of new applications, such as Visual Studio Uses existed 3rd party controls that you can buy or get for free
More flexible The designer in Visual Studio is still, as of writing.
Can do more things without having to write or buy new controls Better for WinForms than for WPF, where you will have to do more of the work yourself with WPF
When you do need to use 3rd party controls, the developers of these controls will likely be more focused on WPF because it's newer Uses existed 3rd party control
XAML makes it easy to create and edit your GUI, and allows the work to be split between a designer (XAML) and a programmer (C#, VB.NET etc.) We can use XAML to design the Windows Forms project forms. Just deserialize the classes in the namespace System.Windows.Forms.
Databinding, which allows you to get a more clean separation of data and layout _
It allows you to make user interfaces for both Windows applications and web applications (Silverlight/XBAP) _

Q6). WPF vs WPF XBAP vs Silverlight


  WPF  WPF XBAP Silverlight Ajax.Net
Client – OS Windows XP SP2 & Vista Windows XP SP2 & Vista Windows XP SP2, Vista, Mac, Linux Any OS
Client – .NET FX .NET 3.0 .NET 3.0 Silverlight Plugin Not required
Client – Browser  NA Internet Explorer 6+ FireFox, Mac Safari, Internet Explorer Any Web Browser
Deployment  Downloadable Installer or ClickOnce Runs in Internet Explorer secure sandbox One-time install of Silverlight plug-in Web Page
When to use Programs that need access to Windows desktop files. Intranet applications for Windows-oriented companies. Rich Internet Applications for public-facing web sites General-purpose public-facing web sites 

Q7). What the common assemblies does WPF use?


  1. PresentationFoundation
  2. WindowsBase
  3. PresentaionCore

Q8). What is Path animation?

Subscribe to our youtube channel to get new updates..!

Ans. Path Animation defined as an AnimationTimeline that uses input as Path geometry.

Check Out WPF Tutorials

Q9). Without XAML can we build WPF applications?

Ans. Yes ofcourse, we can create WPF applications without XAML.

Q10). Name windows types in WPF?


  • Normal Window
  • Page Window and
  • Navigation Window

Q11). Name the WPF layout panels?


  • Canvas
  • WrapPanel
  • StackPanel
  • DockPanel
  • Grid
  • UniformGrid

Q12). Define methods used by Data Objects in WPF?


  • GetData
  • GetDataPresent
  • GetFormats
  • SetData

Q13). Name some pre-defined document formats in WPF?


  • Bitmap
  • CSV file
  • HTML
  • RTF
  • String
  • Text and
  • Audio

Q14). Define BAML?


BAML - Binary Application Markup Language., it is tokenized XAML in binary form and quicker than XAML.

Q15). Define DockPanel Class in WPF?


DockPanel class where a child controls are aligned to the edges of the panel.

Q16). WPF vs. Xamarin.Forms


  WPF  Xamarin.Forms
Control Templates WPF supports the concept of Control Templates which provide the visualization instructions for a control (Button, ListBox, etc.). Xamarin.Forms does have a ControlTemplate type - it is used for theming Page objects.
XAML XAML is supported The syntax is identical - the primary difference is the objects that are defined/created by the XAML graphs.
Markup Extensions In WPF, you must derive from MarkupExtension - an abstract base class. In Xamarin.Forms, that is replaced with an interface IMarkupExtension or IMarkupExtension which is more flexible.
RelativeSource In WPF, these allow you to bind to other visual elements defined in XAML.  In Xamarin.Forms, this same capability can be achieved using the {x:Reference} markup extension
Text property - RelativeSource bindings Text={Binding RelativeSource={RelativeSource otherControl}, Path=Text} Text={Binding Source={x:Reference otherControl}, Path=Text}
Model-View-ViewModel MVVM is completely supported MVVM is completely supported
User Controls In WPF, UserControls are used to provide a section of UI which has associated behavior.  In Xamarin.Forms, we use the ContentView for the same purpose. Both support binding and inclusion in XAML.
Navigation WPF includes a rarely used NavigationService which could be used to provide a "browser-like" navigation feature Xamarin.Forms includes support for several forms of navigation
URL navigation WPF is a desktop-oriented technology and can accept command-line parameters to direct startup behavior.  Xamarin.Forms can use deep URL linking to jump to a page on startup.

Q17). Mention path for selecting DatePicker?


Inheritance Object --> DispatcherObject --> DependencyObject --> Visual --> UIElement --> FrameworkElement --> Control --> DatePicker.

Q18). How TreeView Class helsp in WPF?


TreeView presents the hierarchical collection of labeled items, each of those are indicated by a TreeNode.

Q19). What are the benefits of Graphics in WPF?


  • Resolution-independent and device-independent graphics
  • Improved precision
  • Advanced graphics and animation support
  • Hardware acceleration
Explore WPF Sample Resumes! Download & Edit, Get Noticed by Top Employers!Download Now!