WPF

  Home  Applications Programs  WPF


“WPF Interview Questions and Answers will guide us now that Windows Presentation Foundation (WPF) is a graphical subsystem for rendering user interfaces in Windows-based applications. WPF, previously known as Avalon, was initially released as part of .NET Framework 3.0. Designed to remove dependencies on the aging GDI subsystem, so learn more about WPF with the help of this WPF Interview Questions with Answers guide”



57 WPF Questions And Answers

21⟩ Explain the difference between Silverlight and 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.

 160 views

22⟩ What is MVVM pattern?

MVVM pattern divides the UI code into 3 basic parts:

★ Model:

It represents a set of classes, which contain data received from databases.

★ View:

It is the code that agrees with the visual representation of the data.

★ ViewModel:

It is the layer that binds View and Model together. It presents this data in a manner, which is easy to understand. It also controls how View interacts with the application.

 168 views

28⟩ List the different kinds of Routed events in WPF?

There are three types of Routed events in WPF. They are:

★ Direct:

This event can only be raised by the element in which it was originated.

★ Tunneling:

This event is first raised by the element in which it was originated and then it gets raised by each consecutive container in the visual tree.

★ Bubbling:

This event is first raised by the uppermost container in the visual tree and then gets raised by each consecutive container lying below the uppermost one, till it reaches the element it where it was originated.

 167 views

29⟩ What is 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.

 167 views

31⟩ List the important subsystems in WPF?

The major subsystems are:

★ Windows.Controls.Control

★ Windows.DependancyObject

★ Windows.FrameworkElement

★ Windows.Media.Visuals

★ Object

★ Threading.DispatcherObject

★ Windows.UIElements

 176 views

33⟩ Described 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.

 157 views

34⟩ Explain the difference between MVVM and 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 command objects and data that the view requires. It acts like a container object from which view gets its actions and data.

 154 views

35⟩ How elements in a ListBox 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));

 161 views

36⟩ How 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 drawing. The Visual class also bridges the functionalities of WPF managed classes and the MilCore.dll.

 164 views

39⟩ Is it better to wrap items in ComboBoxItem?

It has some important properties like IsSelected and IsHighlighted and also some necessary events like Selected and Unselected. ComboBoxItem is a content control and is thus very useful for adding simple strings to a ComboBox.

 167 views

40⟩ How you can get Automation IDs of items in a ItemsControl?

The best way to do this is by setting it Name property as it is utilized for automation purposes by default. But if you require to give an ID to an element, other than it's name, then the AutomationProperties.AutomationID property can be set as per need.

 166 views