Ans: Windows Presentation Foundation (WPF) is a User Interface(UI) framework that creates client desktop applications. It supports a set of application development features such as application model, controls, graphics, documents, layout, data-binding, resources, and security. It uses the XAML to provide declarative programming.
Ans: The advantages of WPF include:
Ans: There are two types of document controls that support WPF. They are:
Flow Format document: It is to alter the content in the document to fit on the screen size.
Fixed Format Document: It presents the content irrespective of screen size.
Ans: XAML is an Extensible Application Markup Language. It is easy to define objects and properties in XML.
XAML is used to describe objects, properties, and relation. It helps to create graphical or non-graphical objects.
Ans: Content Alignment is to maintain the position of content on the screen. There are two different properties of Content alignment, one is Horizontal content Alignment and the other is Vertical content Alignment.
These two properties are defined in System.Window.Controls.Control class which is the parent class of all controls in WPF.
Ans: Resources in WPF provide a simple way to reuse defined objects and values. It allows setting the properties of multiple controls at a time.
Syntax for resources in WPF:
Where,
Element Name is the name of an element that uses the resource.
Property Name is the name of the property that takes its value from resources.
Markup Extension defines the type of resources.
KeyName is a unique string to identify the resources.
Ans: There are two types of resources in WPF
Static resources: To define a static resource we use Static resource markup extension and its value is determined at the time of loading.
A sample problem, add the code given below in Window1.xaml file.
Dynamic resources: It is used to change the value of the property at the time of a run.
A sample problem, add the code given below in Window1.xaml file.
Open the code behind, add the snippet code given below.
private void Button_Click(object sender, RoutedEventArgs e) {
this.btn.SetResourceReference(BackgroundProperty, "brush"); }
Ans: Freezable objects are the special objects that have two states: one is Frozen where the objects can no longer be modified, and the other is Unfrozen where objects seem to behave like any other object.
Frozen freezable objects perform better and are also safe when it is required to share between threads.
Ans:
Ans:
Ans: Dependency property is the value that depends on the external, sources such as visual tree inheritance, animation, data binding, styles. It has the in-built feature of providing notification when the property has changed.
Ans: There are three methods present in Dependency objects. They are:
Ans: WPF has three types of Windows.
Ans: A routed event that can invoke users on multiple listeners in an element tree rather than the object that raised an event. It is a CLR event supported by an instance of the routed event class.
Ans: A value converter is a converter that acts as a bridge between the target and the source. It converts the string data to Boolean. It is necessary when a target is bound with one source, for instance, you have a textbox and button control.
To implement a value converter, it is required to assume from I value converter in the system.Windows.Data namespace and implement the two methods Convert and Convert back.
Ans: Prism is a framework that helps to design and build rich, flexible, easy to maintain WPF applications. It provides an implementation of a collection of design patterns that helps to write structured and maintainable XAML applications which includes event aggregation, MVVM, commanding, dependency injection and many more.
Ans: The Model View Viewmodel (MVVM) is a process of creating a client application that leverages the features of the WPF application, allows for a simple unit of testing functionality, to works with less technical difficulties.
Advantages:
Ans:
MVC
|
MVVM
|
Stands for Model View Controller
|
Stands for Model View ViewModel
|
An Architectural pattern which is used for developing UI that divides an application into three interconnected parts such as Model, View, and Controller
|
A software Architectural pattern used for separation of Development of GUI and the development of Business Logic and back-end logic
|
The model represents Data, View represents UI, and Controller handles requests
|
The model represents objects, View represents UI layer, and ViewModel describes the binding between View and model
|
It was used by java springs and ASP.NET
|
It was used by WPF, Angular JS, and Silverlight
|
Ans: Model View ViewModel (MVVM) pattern divides the User Interface code into three parts. They are
Model: It is responsible for data extracted by WPF. It must implement INotify Property Changed as appropriate.
View: It is a code that agrees with the visual representation of data. It is defined by XAML and binds to the view model by using Data binding only.
ViewModel: It is a layer that binds with View and Model together. It exposes the data relevant to view and easy to understand by the user. It also controls how view interacts with the application.
Ans:
Ans: Layout panels are required to arrange the group of GUI elements in the application. A fixed pixel arrangement doesn’t work when the application screen is set to be on a different screen resolution. Hence layout panels help to arrange these elements.
Ans: The major subsystems are:
Ans: Custom control is a class that consists of its own style and theme which are defined in generic.xaml file. It is used when the controls need to support theme and style. It also extends or adds its functionality to fit in the scenario.
Ans: Serialization is the process of converting a state of objects into a stream of bytes.
Ans: Data Binding is a process of getting information from one object to another and displaying it in one or more elements in the User Interface. It is one of the important features of XAML that binds simple data for displaying single value and binds complex data for displaying and formatting a bunch of data. The binding in XAML syntax is {binding….}.
Ans: The four general kinds of elements of XAML are:
Ans: All measurements are made in WPF are pixels. One pixel is 1/96th part of an inch. These pixels are measured as double, this results in the end value as a fractional value
Ans: XAML is an Extensible Application Markup Language. It is used to write a user interface for next-generation applications.
XML is an Extensible Markup Language. It is designed to store the data or to work with stored data.
Ans: Displaying HELLO WORLD
HELLO WORLD!
Ans: The Namespace required for 3D is System.Windows.Media.Medi3D.
Ans.
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)
I would strongly suggest you see the below video which explains all the above A to G points practically.
Ans. Make sure the interviewee understands the following: – How to copy the default style using Expression Blend. – How to change the style – How there must be a Style for each state: Enabled, Disabled, Mouseover, pushed, etc…
Ans. ItemsControl, ListBox, ListView, DataGrid.
– Make sure they know that ListBox and ListView can be selected while ItemsControl does not support selection. – ListView is more feature-rich, as it inherits ListBox, which inherits ItemsControl, and adds features. – Make sure they understand what a DataGrid is and how it is different and why they would display a list in a DataGrid.
Ans. Configure brushes and gradient brushes in the Properties window. Configure the Visual States. Configure sample data. Configure Object Timelines Animation Many design features…
Ans. Write UI in XAML Avoid sizing and positionings, but let objects automatically flow. Enable TextWrapping.
Ans. The initial class loaded using WPF application project is App.App.xaml and App.xaml.cs, even App is also acceptable.
Ans.
You liked the article?
Like: 0
Vote for difficulty
Current difficulty (Avg): Medium
TekSlate is the best online training provider in delivering world-class IT skills to individuals and corporates from all parts of the globe. We are proven experts in accumulating every need of an IT skills upgrade aspirant and have delivered excellent services. We aim to bring you all the essentials to learn and master new technologies in the market with our articles, blogs, and videos. Build your career success with us, enhancing most in-demand skills in the market.