WPF interview questions for fresher /WPF Interview Questions and Answers for Freshers & Experienced

What is data binding in WPF and how is it performed?

Data binding is one of the amazing features in WPF where simple data binding is used for displaying single values and complex data binding is used for displaying a bunch of data. With XAML, data binding is much easier with the help of different elements, objects, properties etc.

Posted Date:- 2021-09-20 04:39:57

What is command pattern in WPF?

A command pattern is a powerful design pattern in WPF that is object-oriented and designed to perform a specific action. The members of a command design pattern in WPF include - Client, Invoker, Command, Concrete Command, Receiver etc.

Posted Date:- 2021-09-20 04:39:16

What is Model-View View-Model in WPF?

MVVM is a framework in WPF that is used for making apps and works similar to MVC architecture. This is 3-tier architecture and we can do loose coupling too with MVVM.

Posted Date:- 2021-09-20 04:38:23

What is IValueConverter used for?

So that a control or control property can be bound to an element of any data type and the conversion happens in the binding process.

Posted Date:- 2021-09-20 04:37:43

How do you bind a bool value to Visibility?

Add a BoolToVisibilityConverter to your resources and then use it as the converter in your Binding.

Posted Date:- 2021-09-20 04:36:56

If you needed to add a line into the Main function, how would you do it?

You add a new class, such as Program.cs, and in the project properties you set Program.cs as the Startup Object.

Posted Date:- 2021-09-20 04:36:14

Write about UserControl in brief.

UserControl wraps existing controls into a single reusable group. It contains a XAML file and a code. UserControl cannot be styled or templated.

Posted Date:- 2021-09-20 04:35:25

What is serialization?

Serialization is a process of converting the state of an object to stream of bytes.

Posted Date:- 2021-09-20 04:34:29

Why are layout panels needed for in WPF?

Layout Panels are needed so that the controls fit screens of different sizes or having different font sizes. If we arrange controls on fixed pixel coordinates, then this model will fail when moved to a different environment. For this reason, Layout panels are necessary.

Posted Date:- 2021-09-20 04:33:21

Write the differences between DynamicResource and StaticResource.

The most basic difference is that StaticResource evaluates the resource one time only, but DynamicResource evaluates it every time the resource is required. And due to this reason, DyanamicResource is heavy on the system but it makes pages or windows load faster

Posted Date:- 2021-09-20 04:32:48

What is the method to force close a ToolTip, which is currently visible?

It can be closed by setting the tooltip’s IsOpen property to false.

Posted Date:- 2021-09-20 04:32:13

What is the basic difference between Events and Commands in the MVVM Model?

Commands are more powerful and are advantageous to use instead of events. Actions are deeply connected with the event’s source and, therefore, the events cannot be reused easily. But commands make it possible to efficiently maintain multiple actions at one place and then reuse them as per our requirement.

Posted Date:- 2021-09-20 04:31:43

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 of Model object is changed.

Posted Date:- 2021-09-20 04:31:04

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 reverse cannot happen.

Posted Date:- 2021-09-20 04:30:32

What is a value converted in WPF?

A value converter acts as the bridge between the target and the source and it is necessary to define when the target is bounded with some source at a particular instance like text control or button controls etc. when you wanted to convert the string to Boolean values, here you need the value converter.

Posted Date:- 2021-09-20 04:11:55

What is the importance of TreeView class in WPF?

A TreeView Class is used to present the hierarchical collection of labeled items and each of them is indicated by the TreeNode.

Posted Date:- 2021-09-20 04:11:21

What are the benefits of Graphics in WPF?

Resolution-independent and device-independent graphics
Improved precision
Advanced graphics and animation support
Hardware acceleration

Posted Date:- 2021-09-20 04:10:51

What is the need of WPF when we had windows forms?

Remember: - ABCDEFG

* 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)

Posted Date:- 2021-09-20 04:10:11

What is the difference between XML and XAML?

Following are the differences between XML and XAML:

1. All XAML docs are also authentic XML documents. However, the reverse cannot be true.
2. XAML is a declarative application language while XML is a markup language.
3. XML is primarily used in web applications. In contrast, the XAML is used to design controls of 4. Windows and other web applications.
4. XAML focuses on object properties, definition and the relationship among them.
5. XML is a markup language produced by W3C and is used to describe other markup languages.

Posted Date:- 2021-09-20 04:09:13

Explain Routed events in WPF.

An event, which can invoke handlers on more than one listeners present in an element tree, instead of the single object which called the event, is known as a Routed event.

Posted Date:- 2021-09-20 04:08:17

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 SortDescription instance defines how the elements should be sorted and indicates if the sort is descending or ascending.

For instance, this code sorts elements of ContentControl on the basis of their word count property:

myItemsControl.Items.SortDescriptions.Add(new SortDescription(“WordCount”, ListSortDirection.Descending));

Posted Date:- 2021-09-20 04:07:22

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.

Posted Date:- 2021-09-20 04:06:52

How does TreeView Class help in WPF?

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

Posted Date:- 2021-09-20 03:58:39

Mention the path for selecting DatePicker?

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

Posted Date:- 2021-09-20 03:58:16

What are the standard file formats supported by the WPF framework?

These are the bitmap, HTML, CSS file, RTF< String, Text, or Audio formats etc.

Posted Date:- 2021-09-20 03:57:54

What are the methods used by the data objects in WPF?

These are GetData, SetData, GetFormats, or GetDataPresent etc.

Posted Date:- 2021-09-20 03:57:17

Name the different types of layout panels in WPF.

These are Canvas, Grid, Uniform Grid, Wrap Panel, Dock Panel, or Stack Panel etc.

Posted Date:- 2021-09-20 03:56:59

Define the Attachment Property in WPF.

The attachment property is a special category of Dependency Property that can be declared in one class used in another class. Grid.Row, Grid.Column are the perfect example of attach properties in WPF.

Posted Date:- 2021-09-20 03:55:30

What is Command Design Pattern in WPF?

Command Design Pattern is one of the most powerful design patterns in object oriented design patterns. This pattern allows you to decouple the request of an action from the object that actually performs an action, in other words a command pattern represents an action as an object. A Command object does not contain the functionality that is to be executed. This removes the direct link between the command definitions and the functionality and it’s promoting a loose coupling. When you want to implement operations based on the user request then the command pattern is the best pattern to handle your object.

The following are the members of the Command Design Pattern:

* Client
* Invoker
* Command
* Concrete Command
* Receiver

Posted Date:- 2021-09-20 03:55:10

What are differences between Visibility.Collapsed and Visibility.Hidden in WPF?

<> Visibility.Hidden hides the control, but reserves the space it occupies in the layout. So it renders whitespace instead of the control.
<> Visibilty.Collapsed does not render the control and does not reserve the whitespace. The space the control would take is 'collapsed', hence the name.

Posted Date:- 2021-09-20 03:52:46

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

Posted Date:- 2021-09-20 03:51:32

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 WindowsFormsHost control that comes preinstalled.

Posted Date:- 2021-09-20 03:51:03

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.

Posted Date:- 2021-09-20 03:50:33

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 that applications made in WPF depend on the OS as .NET Framework only runs on Windows. On the other hand, the Silverlight plug-in can be installed on those OSs also, which are not Windows.

Posted Date:- 2021-09-20 03:50:05

What is PresentationCore Assembly?

PresentationCore assembly provides Visual class which all the visual controls in WPF are inherit. This assembly directly interacts with MilCore unmanaged assembly for rendering the visual system.

Posted Date:- 2021-09-20 03:48:42

How the vales for Dependency Property can be validated?

Here, you can define the callback and get the notification whenever it changed. If the value of callback function is true then it is valid otherwise not authentic.

Posted Date:- 2021-09-20 03:48:25

How will you define the Dependency Property in WPF?

This is a special property that could participate in DPS (Dependency Property System). It is computing values from multiple inputs at the runtime. The property can be defined with the help of different parameters in WPF like data binding, styling, inheritance, or animation etc.

Posted Date:- 2021-09-20 03:46:13

Do XAML code after compilation is converted to assembly code?

Yes, it is converted and stored as BAML (Binary Application Markup Language) into the assembly.

Posted Date:- 2021-09-20 03:45:52

Define DockPanel Class in WPF?

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

Posted Date:- 2021-09-20 03:45:21

Define BAML?

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

Posted Date:- 2021-09-20 03:45:05

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

Posted Date:- 2021-09-20 03:44:19

Define methods used by Data Objects in WPF?

* GetData
* GetDataPresent
* GetFormats
* SetData

Posted Date:- 2021-09-20 03:40:54

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 have XPS XAML which defines an XML representation of electronic documents.
Silverlight XAML is a subset of WPF XAML meant for Silverlight applications. Silverlight is a cross-platform browser plug-in which helps us to create rich web content with 2-dimensional graphics, animation, and audio and video.
* WWF XAML helps us to describe Windows Workflow Foundation content. WWF engine then uses this XAML and invokes workflow accordingly.

Posted Date:- 2021-09-20 03:38:59

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.

Posted Date:- 2021-09-20 03:38:11

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.

Posted Date:- 2021-09-20 03:36:32

Name the namespace required for working with 3D.

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

Posted Date:- 2021-09-20 03:33:43

Explain WPF styles

WPF styles work just like CSS style, In the CSS we define styles for a control and we reuse the same where ever we need in the application, same way the styles in WPF allows to define the properties and can be reused in the application.

Posted Date:- 2021-09-20 03:33:01

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 application with WPF and the same UI can be displayed on the browser using WPF browser or Silverlight application.

Posted Date:- 2021-09-20 03:32:42

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 format document present content irrespective of the screen size.

Posted Date:- 2021-09-20 03:32:14

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 etc.
* Supports flow and fix format documents
* all the functionality of Flash and HTML
* Data binding
* Multimedia
* Animation

Posted Date:- 2021-09-20 03:31:42

Search
R4R Team
R4R provides WPF Freshers questions and answers (WPF Interview Questions and Answers) .The questions on R4R.in website is done by expert team! Mock Tests and Practice Papers for prepare yourself.. Mock Tests, Practice Papers,WPF interview questions for fresher ,WPF Freshers & Experienced Interview Questions and Answers,WPF Objetive choice questions and answers,WPF Multiple choice questions and answers,WPF objective, WPF questions , WPF answers,WPF MCQs questions and answers R4r provides Python,General knowledge(GK),Computer,PHP,SQL,Java,JSP,Android,CSS,Hibernate,Servlets,Spring etc Interview tips for Freshers and Experienced for WPF fresher interview questions ,WPF Experienced interview questions,WPF fresher interview questions and answers ,WPF Experienced interview questions and answers,tricky WPF queries for interview pdf,complex WPF for practice with answers,WPF for practice with answers You can search job and get offer latters by studing r4r.in .learn in easy ways .