WPF Interview Questions and Answers (67) - Page 1

What is WPF?

Windows Presentation Framework is the new
presentation API in WinFX. WPF is a two and three dimensional graphics engine. It has
the following capabilities:-
v Has all equivalent common user controls like buttons, check boxes sliders etc.
v Fixed and flow format documents
v Has all of the capabilities of HTML and Flash
v 2D and 3D vector graphics
v Animation
v Multimedia
v Data binding
What is XAML?

XAML (pronounced as Zammel) is a declarative XML-based language by which you can
define object and properties in XML. XAML document is loaded by a XAML parser.
XAML parser instantiates objects and set there properties. XAML describes objects,
properties and there relation in between them. Using XAML you can create any kind of
objects that means graphical or non-graphical. WPF parses the XAML document and
instantiates the objects and creates the relation as defined by XAML.
What are attached properties?

These are dependency properties that belong to one class but can be used in another.
Consider the below code snippet:-
<Rectangle Height="72" Width="131" Canvas.Left="74" Canvas.Top="77" />
4 7 9
Height and Width are regular properties of the Rectangle. But Canvas.Top and Canvas.
Left is dependency property as it belongs the canvas class. It’s used by the Rectangle to
specify its position within Canvas.
What is a Routed event?

In a typical WPF application, it contains many elements. These elements exist in an element tree relationship with each other. A routed event is a type of event that can invoke handlers on multiple listeners in an element tree, rather than just on the object that raised the event.
What are the core WPF assemblies?

The core WPF assemblies are,

WindowsBase.dll:- It defines the core types constituting the infrastructure of WPF API.

PresentationCore.dll:- Defines numerous types constituting foundation of WPF GUI layer.

PresentationFoundation.dll:- It defines WPF control types, animation & multimedia support, data binding suport and other WPF services.

Besides these three libraries WPF also uses an unmanaged binary called milcore.dll which acts as a bridge between WPF assemblies and DirectX runtime layer.
What is the use of System.Windows.Media namespace?

It is the root namespace to several other media related namespaces. It provides different types to work with animations, 3D rendering, text rendering and other multimedia services.
What is WPF?

Microsoft has introduced WPF(Windows Presentation Foundation) API in .NET3.0 framework for the first time. WPF merged all the unrelated APIs into a single unified object model. So if you want to use 3D graphics or multimedia for your application you do not use to need use different APIs. WPF provides all the functionalities you need to develop richer GUI applications.

Using WPF we can develop GUI for both windows application and web application.
How to define a button USING XAML?

To define a button in WPD using XAML use the following syntax,
<Button Name="btnName">btnCaption</Button>


Example:-
<Button Name="btnClick">Click Me</Button>

Here the <Button> element specifies the use of the Button class.
What is the use of "System.Windows.Markup" namespace in WPF?

The System.Windows.Markup namespace provides some helper classes for XAML code.
Which namespace provide classes for integration with WPF and Win32?

The "System.Windows.Interop" namespace provides classes for integration of WPF with Win32.
Which class of the WPF is the base class of all the user-interactive elements?

NOTE: This is objective type question, Please click question title for correct answer.
Which class is the base class of all the visual elements of WPF?

NOTE: This is objective type question, Please click question title for correct answer.
Control class of WPF is derived from which class?

NOTE: This is objective type question, Please click question title for correct answer.
The core classes for User Interface is located in which namespace?

NOTE: This is objective type question, Please click question title for correct answer.
Which namespace provide classes to work with images, sound, video, etc?

The System.Windows.Media namespace provide classes to work with images, sound, video, etc in WPF.
What is the use of System.Windows.Navigation namespace in WPF?

System.Windows.Navigation namespace contains different classes for navigation between windows.
What is 'One-way-to-Source ' binding property?

In One-way-to-Source binding when the target property changes, the source object gets updated.
Which namespace is used to work with 3D in WPF.

The System.Windows.Media.Medi3D namespace is used to work with 3D.
Which of these is not a class defined by System.Windows.Shapes namespace?

NOTE: This is objective type question, Please click question title for correct answer.
Found this useful, bookmark this page to the blog or social networking websites. Page copy protected against web site content infringement by Copyscape

 Interview Questions and Answers Categories