Wpf Interview Questions And Answers

Wpf interview questions and answers on advance and basic Wpf with example so this page for both freshers and experienced condidate. Fill the form below we will send the all interview questions on Wpf also add your Questions if any you have to ask and for apply in Wpf Tutorials and Training course just send a mail on info@pcds.co.in in detail about your self.


Top Wpf interview questions and answers for freshers and experienced

What is Wpf ?

Answer :

Questions : 1 :: What is XAML in WPF and why do we need it?

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...View answers

Questions : 2 :: What is xmlns in XAML file?

“xmlns” stands for XML namespaces. It helps us to avoid name conflicts and confusion in XML documents. For example consider the below two XML which have table elements, one table is a...View answers

Questions : 3 :: What is the difference between xmlns and xmlns:x in WPF ?


Bothe namespaces helps to define / resolved XAML UI elements. The first namespace is the default namespace and helps to resolve overall WPF elements. Hide   Copy...View answers

Questions : 4 :: Provide some instances where you have "xmlns:x" namespace in XAML ?

There are two common scenarios where we use “xmlns:x” namespace :- To define behind code for the XAML file using “x:class” attribute. Hide   Copy Code <Page...View answers

Questions : 5 :: When should we use "x:name" vs "name" ?

There is no difference between “x:name” and “name” , “name” is short hand of “x:name”. But in classes where you do not find “name” property...View answers

Questions : 6 :: Can you explain the complete WPF object hierarchy?


Object: - As WPF is created using .NET so the first class from which WPF UI classes inherits is the .NET object class. Dispatcher: - This class ensures that all WPF UI objects can be accessed...View answers

Questions : 7 :: Does that mean WPF has replaced DirectX?

No, WPF does not replace DirectX. DirectX will still be still needed to make cutting edge games. The video performance of directX is still many times higher than WPF API. So when it comes to game...View answers

Questions : 8 :: So is XAML meant only for WPF ?

No,XAML is not meant only for WPF.XAML is a XML-based language and it had various variants. WPF XAML is used to describe WPF content, such as WPF objects, controls and documents. In WPF XAML we also...View answers

Questions : 9 :: Can you explain the overall architecture of WPF?


Above figure shows the overall architecture of WPF. It has three major sections presentation core, presentation framework and milcore. In the same diagram we have shown how other section like...View answers

Questions : 10 :: What is App.xaml in WPF project?

App.xaml is the start up file or a boot strapper file which triggers your first XAML page from your WPF project.

Questions : 11 :: What are various ways of doing alignment in WPF?

There are five ways of doing alignment in WPF:- Grid:- In Grid alignment we divide the screen in to static rows and columns like HTML tables and position elements in those rows and column...View answers

Questions : 12 :: What are resources in WPF?

Resources are objects referred in WPF XAML. In C# code when we create an object we do the following three steps :- Hide   Copy Code using CustomerNameSpace; // import the...View answers

Questions : 13 :: Explain the difference between static and dynamicresource?

Resources can be referred statically or dynamically. Static referred resources evaluate the resource only once and after that if the resources change those changes are not reflected in the binding....View answers

Questions : 14 :: When should we use static resource over dynamic resource ?

Dynamic resources reduce application performance because they are evaluated every time the resource is needed. So the best practice is use Static resource until there is a specific reason to use...View answers

Questions : 15 :: Explain the need of binding and commands?

WPF Binding’s helps to send / receive data between WPF objects while command helps to send and receive actions.The object that emits data or action is termed as source and the object who wants...View answers

Questions : 16 :: Explain one way, two way, one time and one way to source?

All the above 4 things define how data will flow between target and source objects when WPF binding is applied. Two way: - Data can flow from both source to target and from target to source. One...View answers

Questions : 17 :: Can you explain WPF command with an example?

When end users interact with application they send actions like button click, right click , control + c, control + v etc. A command class in WPF wraps these end user actions in to a class so that...View answers

Questions : 18 :: How does "UpdateSourceTrigger" affect bindings?

“UpdateSourceTrigger” decides when the data should get updated between WPF objects that are binded. In other word should data get updated in lost focus event, in data change event...View answers

Questions : 19 :: Explain the need of "INotifyPropertyChanged" interface?

When we bind two WPF objects the target data is updated depending on the “UpdateSourceTrigger” events. Please refer the previous question for “UpdateSourceTrigger” basics.The...View answers

Questions : 20 :: What are value converters in WPF?

Binding is one of the big features in WPF which helps us to facilitate data flow between WPF UI and Object. But when data flows from source to UI or vice-versa using these bindings we need to convert...View answers

Questions : 21 :: Explain multi binding and multivalue converters in WPF?

MultiBinding” helps you bind multiple sources to a target while multi-converters acts like bridge if the source and targets have different data formats or need some conversion. For example...View answers

Questions : 22 :: Explain WPF relative binding / relative resource?

When we define bindings we need at least two elements target and source. But many times rather than defining binding between two elements we would like to define binding with reference to the current...View answers

Questions : 23 :: What are the different ways of binding using relative source?

There are four ways of binding relatively in WPF :- Self Ancestor Previousdata Templated parent

Questions : 24 :: Can you explain self relative source binding in WPF?

This relative binding helps to bind to one property of an element to the other property of the same element. For example in the below XAML the border width is binded to height of the same border...View answers

Questions : 25 :: Explain Ancestor relative source binding in WPF?

This relative binding helps to bind properties to the parent element properties. For example in the below XAML code we have a textbox which has two border’s as a parent. One border is having...View answers

Questions : 26 :: Explain the difference between visual and logical tree in WPF ?

WPF UI is represented in XAML which is a XML format. In XML elements are arranged in a hierarchal fashion. For example if you look at the below XAML (it has been downsized for simplicity) we have a...View answers

Questions : 27 :: Why do we need to have these perspective of visual and logical tree in WPF ?

Visual tree and Logical tree are important when you work with WPF routed events.

Questions : 28 :: Explain routed events in WPF?

Routed events are those events which travel up or down the visual tree hierarchy. WPF events can be classified in to 3 types:- Direct events: - In this case event is raised at the source and handled...View answers

Questions : 29 :: What are styles in WPF?

WPF style helps to define look and feel ( color , fonts, alignments etc) from a central location so that we can have ease of maintenance.For more details on WPF styles please check this link out...View answers

Questions : 30 :: What are style triggers?

Many times we would want a style property to execute under certain conditions. Trigger’s help you to define condition under which the style values will be set. For instance in the below XAML...View answers

Questions : 31 :: What is MVVM?

MVVM is an architecture pattern where we divide the project in to three logical layers and every layer has its own responsibility. Below are the three logical layers with explanation what they...View answers

Questions : 32 :: What are the benefits of MVVM?

Below are the benefits of MVVM pattern:- Separation of concern: - As the project is divided in to layers, every layer handles its own responsibility. This leads to better maintenance because when we...View answers

Questions : 33 :: What is the importance of command and bindings in MVVM pattern?

MVVM in the most used architecture because of command and bindings facility provided by WPF. WPF MVVM is incomplete without command and bindings. Command and bindings helps you to connect view...View answers

Questions : 34 :: What is the difference between MVVM and 3 layer architecture?

MVVM has an extra layer as compared to 3 layer architecture. In 3 layer architecture we have UI (view) , business logic ( model) and Data access layer ( DAL). In MVVM we have an extra layer in...View answers

Questions : 35 :: Explain delegate command?

First let us answer in short: - “Delegate command makes a MVVM command class independent of the view model”. Now let’s understand the long way. In MVVM architecture view talks with...View answers

Questions : 36 :: What is PRISM?

PRISM is a framework to develop composite application in WPF and Silverlight. Composite applications are built using composition. In other words rather than building application from scratch we take...View answers

Questions : 37 :: What are benefits of PRISM?

Modular development: - As we are developing components as independent units we can assign these units to different developers and do modular parallel development. With parallel development project...View answers

Questions : 38 :: How are individual units combined in to a single unit?

PRISM uses dependency injection for the same. Please see design pattern section to read about DI (dependency injection). We can do DI by two way’s by using unity application block or MEF (...View answers

Questions : 39 :: Does PRISM do MVVM?

The prime focus of PRISM is modular development and not MVVM. But it does have readymade classes like delegate command which can help us reduce MVVM code. But please note the main goal of PRISM was...View answers

Questions : 40 :: Is PRISM a part of WPF?

No, PRISM is a separate installation.

Questions : 41 :: What is expression blend?

Expression blend is a designing tool for WPF and SilverLight application.

Questions : 42 :: What is WPF?

WPF is the latest presentation API by Microsoft Windows. It is 2D and 3D graphic engine. Its capabilities include:- All the common user controls. For example, check boxes, buttons, sliders...View answers

Questions : 43 :: What are the types of documents supported by WPF?

Two types of the documents supported by Windows Presentation Foundation (WPF) are the Flow format and fixed Format document. Flow format document alters the content to fit the screen size while fixed...View answers

Questions : 44 :: Name the namespace required for working with 3D.

The namespace required for working in 3D is System.Windows.Media.Medi3D.

Questions : 45 :: Is it right to say that WPF has replaced DirectX?

No, WPF can never replace DirectX. WPF cannot be used to create games with stunning graphics. WPF is meant to be a replacement for windows form, not DirectX.

Questions : 46 :: What are dependency properties?

Properties that belong to a specific class but can be used for another are called the dependency properties

Questions : 47 :: How can the size of StatusBar be increased proportionally?

By overruling the ItemsPanel attribute of StatusBar with a grid. The grid’s columns can be appropriately configured to get the desired result.

Questions : 48 :: What are Freezable objects in WPF?

An object, which has its state locked down, so that it becomes unchangeable, is known as a freezable object. Such objects perform better. It is also safer if they are required to be shared between...View answers

Questions : 49 :: Why should WPF be preferred over Adobe Flash?

WPF is a more recent technology and thus has the latest development tools. It supports a broader range of programming languages and has a robust control reuse.

Questions : 50 :: How is Silverlight different from WPF browser application?

One of the major differences is that .NET framework is required for running WPF browser applications on the client machine. But Silverlight runs using only the plug-in. Another point of difference is...View answers

Questions : 51 :: Name the methods present in the DependencyObject.

t has three objects, namely: SetValue ClearValue GetValue

Questions : 52 :: Write about PRISM.

PRISM is a framework for creating complex applications for WPF, Silverlight or Windows Phone. PRISM utilizes MVVM, IC, Command Patterns, DI and Separation of Concerns to get loose coupling

Questions : 53 :: Is it possible to use Windows Forms in a WPF application?

Yes, Windows form can be used in WPF. Windows form can appear as a WPF pop. The controls of this Window form can be placed besides WPF controls in a WPF page by utilizing the functions of the...View answers

Questions : 54 :: Describe CustomControl briefly.

CustomControl widens the functions of existing controls. It consists of a default style in Themes/Generic.xaml and a code file. It is the best way to make a control library and can also be styled or...View answers

Questions : 55 :: Name the common assemblies used in WPF?

PresentationFoundation WindowsBase PresentaionCore

Questions : 56 :: Define Path animations in WPF

Path animation is a type of animation in which the animated object follows a path set by the Path geometry

Questions : 57 :: Can WPF applications be made without XAML?

Yes WPF applications can be created without XAML as using XAML in WPF is a matter of choice.

Questions : 58 :: What are the types of windows in WPF?

WPF has three types of windows: Normal Window Page Window Navigate Window

Questions : 59 :: How can elements in a ListBox be sorted?

Sorting can be done by using a property of the ItemsCollection object. ItemsCollection contains an attribute, SortDescriptions, which holds System.ComponentModel.SortDescription instances. Every...View answers

Questions : 60 :: 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...View answers

Questions : 61 :: How is System.Windows.Media.Visual dll utilized in WPF?

It is used whenever a requirement for creating custom user interface arises. It is a drawing object, which gives instructions for making an object. These instructions include opacity etc. of the...View answers

Questions : 62 :: What are the various layout panels in WPF?

They are: Stack Panel Grid Panel Canvas Panel Dock Panel Wrap Panel

Questions : 63 :: Name the important subsystems in WPF

The major subsystems...View answers

Questions : 64 :: What does BAML mean in WPF?

BAML is the abbreviation for Binary Application Markup Language. It is nothing but XAML that has been tokenized, parsed and changed into binary form. BAML is a compressed declarative language, which...View answers

Questions : 65 :: What is Difference between Page and Window Controls in WPF?

The basic difference is that Window Control presides over Windows Application while Page Control presides over the hosted Browser Applications. Also, Window control may contain Page Control, but the...View answers

Questions : 66 :: What are Attached Properties in WPF?

Attached properties are basically Dependency Properties that allows the attachment of a value to any random object.

Questions : 67 :: What is the INotifyPropertyChanged Interface?

The InotifyPropertyChanged notifies clients, generally those who are binding, if the value of a property gets changed. It has an event, called PropertyChanged, which gets raised everytime a property...View answers

Questions : 68 :: What kind of questions would you expect someone to know during an interview for a job doing WPF/Silverlight development?

Strong .NET 2.0 Background & willing to learn! Explain dependency properties? What's a style? What's a template? Binding Differences between base classes: Visual, UIElement,...View answers

Questions : 69 :: Write the differences between DynamicResource and StaticResource.

The most basic difference is that StaticResource evaluates the resource one time only, butDynamicResource evaluates it every time the resource is required. And due to this reason,DyanamicResource is...View answers

Questions : 70 :: Why are layout panels needed for in WPF?

Layout Panels are needed so that the controls fit screens of different sizes or having differentfont sizes. If we arrange controls on fixed pixel coordinates, then this model will fail when movedto a...View answers
More Question

Ask your interview questions on Wpf

Write Your comment or Questions if you want the answers on Wpf from Wpf Experts
Name* :
Email Id* :
Mob no* :
Question
Or
Comment* :
 

  






--------- Tutorials ---