Blog

  • Home
  • WPF
  • WPF Interview Questions And Answers

WPF Interview Questions And Answers

  • (4.0)
  • | 1244 Ratings

WPF Interview Questions And Answers

Mindmajix as a team have 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, 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.

Are you interested in taking up for WPF Certification Training? Enroll for Free Demo on WPF Training!

Q. Define WPF and its features?

Windows Presentation Foundation (WPF) is an 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

Q. Which types of documents controls does wpf supports?

There are two types of WPF controls:

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

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

System.Windows.Media.Media3D supports 3-D presentation in WPF.

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

BrushValueSerializer calss.

Q. 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) _

Q. 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 

Q. What the common assemblies does WPF use?

  1. PresentationFoundation
  2. WindowsBase
  3. PresentaionCore

Q. What is Path animation?

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

Check Out WPF Tutorials

Q. Without XAML can we build WPF applications?

Yes ofcourse, we can create WPF applications without XAML.

Q. Name windows types in WPF?

  • Normal Window
  • Page Window and
  • Navigation Window

Q. Name the WPF layout panels?

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

Q. Define methods used by Data Objects in WPF?

  • GetData
  • GetDataPresent
  • GetFormats
  • SetData

Q. Name some pre-defined document formats in WPF?

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

Q. Define BAML?

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

Q. Define DockPanel Class in WPF?

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

Q. 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.

Q. Mention path for selecting DatePicker?

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

Q. How TreeView Class helsp in WPF?

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

Q. 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!