InterviewSolution
This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.
| 1. |
Explain path animation in WPF. |
|
Answer» In Path animations, an ANIMATED object follows a path set by a Path geometry. The PathGeometry property of the PathAnimation can be set by defining a geometric path. You can use path animations to animate objects along a complex path. A complex animation can be created by joining together straight lines, arcs, and Bezier curves in any order. ConclusionMicrosoft's WPF is the best WAY to DEVELOP Windows-based applications, and that will likely continue to be true in the future. As of now, a lot of companies have heavily invested in the WPF infrastructure, so they are reluctant to invest in something else. Whether you are new to WPF architecture or have experience with it, you will need to keep certain basic concepts in mind before you GO to an interview. When you are interviewing for a software development job, employers will probably ask you several questions to DEMONSTRATE your WPF expertise. In this article, we have prepared a list of 30+ WPF interview questions that will help you prepare for your WPF interview. The answers to each question are based on extensive research and tailored to meet the expectations of the interviewer. Additional Useful Resources:
|
|
| 2. |
Can you explain what is the Prism framework in WPF? |
|
Answer» Prism, also known as COMPOSITE Application Guidance/Library, is a framework that ENABLES you to design and develop rich, loosely coupled, flexible, testable, and easy-to-maintain desktop applications, Silverlight Rich INTERNET Applications (RIAs), and Windows Phone applications. Using modular development, the client application can be developed in a way that SIMPLIFIES the complexity of a large application. Applications built with Prism are composed of modules, which are reusable functional units that contain a portion of the application's overall functionality. As modules can be developed, tested, and deployed individually, cross-team DEPENDENCIES can be minimized, and team members can focus on specific aspects of a project. Major Components of Prism:
All the applications modules (A, B, C, and D as shown in the above diagram) are loaded in shell and the bootstrapper is responsible for connecting the modules to the shell. |
|
| 3. |
State difference between Silverlight and WPF Browser application. |
||||||||||||||
|
Answer» Microsoft offers two different products - Silverlight and Windows Presentation Foundation (WPF). These products differ in the following way:
|
|||||||||||||||
| 4. |
What do you mean by templates in WPF? |
|
Answer» WPF templates define the overall visual appearance and look of a control. There is always a default template associated with each control, which determines how it LOOKS. If you NEED to customize the visual behaviour of control or the visual appearance of it, you can easily create your own templates in WPF applications. Through data binding, the programming logic and the template can be connected. FOLLOWING is a list of four types of templates:
|
|
| 5. |
Explain XAML in WPF and why do we need it? |
|
Answer» The Extensible Application Markup Language (XAML) by Microsoft is a new declarative programming language DESIGNED to create user INTERFACES for managed applications. WPF uses XAML to construct GUI (Graphical User Interface) for Windows applications. XAML is a markup language designed for creating user interfaces that look like XML (Extensible Markup Language). XAML is optional (in TERMS of usage), but it serves as the core of the WPF UI design. Advantages of XAML-
|
|
| 6. |
Explain Rotate transform in WPF. |
|
Answer» Rotate transforms, as their name indicates, rotate an element around a specified angle. You can rotate a control, shape, or another element by certain degrees around a point by using the Rotate transform. In this WAY, you can create interesting user interfaces with both static and animated rotation. WPF provides a RotateTransform object that represents rotation. The Angle property indicates the degree of rotation in the clockwise direction. An element may also be rotated anticlockwise by setting a negative value. The X and Y coordinates of the center point are represented by the CenterX and CenterY PROPERTIES. By default, it uses the TOP leftmost corner of a given element as the center point and rotates it accordingly. Example: The FOLLOWING code creates two rectangles of equal size, but rotates the second rectangle by 45 degrees. <Grid> <!-- Original Rectangle --> <Rectangle Width="200" Height="50" Fill="Yellow"/> <!-- Rectangle with 45 degrees rotation --> <Rectangle Width="200" Height="50" Fill="Blue" Opacity="0.5" Margin="61,27,117,184"> <Rectangle.RenderTransform> <RotateTransform CenterX="-50" CenterY="50" Angle="45" /> </Rectangle.RenderTransform> </Rectangle> </Grid>As you can see in the following output, the second rectangle has been rotated by 45 degrees. |
|
| 7. |
Explain Routed Events in WPF. |
|
Answer» Routed events are those that follow a specific routing strategy in order to move up or down the visual tree. Event handlers can be hooked up to the element that triggers the event or to multiple elements above and below it.
|
|
| 8. |
What are Attached properties in WPF? |
|
Answer» An attached property is a concept in XAML (Extensible Application Markup Language). ESSENTIALLY, these properties ENABLE you to assign extra properties/values to any XAML element, even if it doesn't define them in its object model. As a special type of DependencyProperty, you can apply it to any DependencyObject to enhance the behavior of various controls and services. Attached properties would be useful in the following cases:
|
|
| 9. |
What are Dependency properties in WPF? |
|
Answer» WPF dependency properties are properties that extend the functionality of CLR (Common LANGUAGE Runtime) properties. Dependency properties are those whose value is dependent on external sources (value from other inputs), such as animation, data binding, styles, themes, and USER preferences, or visual TREE inheritance. These properties provide self-contained validation, default values, monitoring of changed properties, and other runtime information. Advantages of Dependency Property:
|
|
| 10. |
Can you explain value convertor in WPF? |
|
Answer» With WPF binding, you can bind two WPF UI objects and flow data between them. Objects emitting data are called sources, and objects accepting them are called targets. ValueConverter is a piece of code that CONVERTS values from the source TYPE to the target type and back again, so you can databind PROPERTIES that have incompatible types. A value converter implements IValueConverter, a simple interface that provides two methods: Convert() and ConvertBack(). As a bridge between the source and target, WPF converters PROVIDE a way to convert data if the target and source have different data formats. |
|
| 11. |
Explain how MVVM (Model-View ViewModel) is different from MVC (Model-View Controller). |
||||||||||||||
|
Answer» MVVM and MVC differ in the FOLLOWING ways: MVVM Pattern MVC Pattern
|
|||||||||||||||
| 12. |
What are the important features of MVVM? |
|
Answer» The following are some of the features of MVVM:
|
|
| 13. |
What do you mean by MVVM (Model View ViewModel)? |
|
Answer» MVVM (Model-View-ViewModel) is a pattern that is used extensively by the Windows Presentation Framework (WPF) for building applications. MVVM is not mandatory to create WPF applications, but knowing about it can simplify the process of building WPF applications. This method allows developers and designers to work together without a great deal of technical difficulty by utilizing the capabilities of the WPF platform. There are three main components of MVVM as shown below:
By calling the public methods in the Model classes, the ViewModel interacts with the Model. Model data is collected and sent to the View. Using WPF's data-binding and COMMAND features, the View interacts with the ViewModel. The ViewModel implements commands that are EXECUTED whenever a user interacts with the view. |
|
| 14. |
Difference between WPF and Winforms. |
||||||||||||||||
Answer»
Difference between WPF and Winforms:
|
|||||||||||||||||
| 15. |
State difference between WCF (Windows Communication Foundation) and WPF (Windows Presentation Foundation). |
Answer»
|
|