Buy Questpond's video subscriptions on
huge discount
.
Online: 2949
Home
Articles
Interviews
Forums
For Beginners
Popular Questions
ITIL Career Advice
PMP Career Advice
Career Advices
Codes
Videos
ASP.NET
ASP.NET MVC
Android Intel XDK
Sql Server
AngularJS
Bootstrap
Backbone.JS
MongoDB
LESS (CSS)
jQuery
WPF
WWF
SSIS
LightSwitch
Tutorials
News
ASP.NET MVC
|
Be Interview Ready
|
Top Performers
|
DNF MVP
|
Top Posts
|
Winners
|
Subscribe
|
Catalogs
Welcome Guest !
Register
Login
Home
>
Interviews
> WPF
WPF Interview Questions and Answers (67) - Page 3
Latest and authentic Interview questions. You can also
post an interview question
and
win monthly prizes
as well as gain community
credit points
.
67 records found.
Post
|
Interview Experiences
|
Interview FAQs
|
Online Interviews
|
Exclusive Questions
Get 650+ Questpond's Interview videos on discount
Loading ...
What is Dependency Properties and its Use in WPF?
* Dependency properties are used to enable styling, automatic data binding, templates, animation etc.
* All types that want to use DependencyProperties must derive from 'DependencyObject' class.
* The value of a DependencyProperty is resolved dynamically when read.
* The value of a dependency property is stored in a dictionary of keys and values provided by 'DependencyObject' class.
* Advantages:
1) Reduced memory footprint
2) Value Inheritance
3) Change Notification
What are the Types of Resources in WPF?
1) Binary Resources
Binary resources could be logo/image files, AV files etc.
2) Logical Resources are of tow types:
Static and Dynamic Resources
* StaticResource finds the key defined within the ResourceDictionary under its scope during the Loading of the application.
* Hence the Compiler will throw error during compilation if not found in resources.
--
* DynamicResource Markup Extension defers the resource assignment to the actual runtime of the application.
* So the expression remains unevaluated until the object being created.
What are Binary Resources in WPF?
* Binary resources could be logo/image files, AV files etc.
* Resource files which are added to project, can have the “Build Action” defined on it from the file properties windows:
- Resource : Embeds resource into the assembly (or culture specific satellite assembly)
- Content : this leaves resource as loose file and upon compilation this resource information is not embedded to assembly. Instead, it adds custom attribute to the assembly (AssemblyAssociatedContentFile) which records the existence and relative location of file.
What are Static Resources in WPF?
* StaticResource finds the key defined within the ResourceDictionary under its scope during the Loading of the application.
* Hence the Compiler will throw error during compilation if not found in resources.
What are Dynamic Resources in WPF?
* DynamicResource Markup Extension defers the resource assignment to the actual runtime of the application.
* So the expression remains unevaluated until the object being created.
What is the Choice between StaticResource and DynamicResource in WPF?
* StaticResource requires less CPU during runtime, so it is faster.
* StaticResource are created when the application loads. So making everything as StaticResource means slowing down the Application Load process.
* When the resources are unknown during compilation, you can use DynamicResource.
* DynamicResource are used when user interaction changes the look and feel of an object.
What are Triggers and its type in WPF?
* The WPF styling and templating model enables you to specify Triggers within your Style.
* Essentially, Triggers are objects that enable you to apply changes when certain conditions (such as when a certain property value becomes true, or when an event occurs) are satisfied.
* Types of triggers:
1) Property triggers get active when a property gets a specified value.
2) Data triggers get active when a specified event is fired.
3) Event triggers get active when a binding expression reaches a specified value.
What are Templates and its type in WPF?
* A Template is used to change how a control looks.
* Types of templates:
1) Control template: How a control is rendered and behaves by specifying the visual structure and behavioral aspects.
2) Data template: To specify the visualization of data objects.
3) Hierarchical data template: Used over hierarchical structure like TreeView and Menu.
What is application object and its reponsiblity?
* Application is a class that represents a WPF application running as a standalone client application in Windows.
* Each running application contains at most a single instance of Application.
* The Application object is defined in the App.xaml file and is responsible for:
- Managing application lifetime (e.g. responding to startup/shutdown events)
- Window, property and resource management
- Command-line processing
- Navigation
What is the Application Lifetime in WPF?
The main events fired from Application include:
* Startup - Application is starting up.
* Exit – Fired when an application is shutting down.
* Activated – Fired when an application gets focus, i.e. becomes the foreground application
* Deactivated – Fired when application loses focus, i.e. is no longer the foreground application
* DispatcherUnhandledException – Fired when an exception is thrown, but not yet handled. You can choose to handle the exception or not
* SessionEnding – Fired when Windows is being shut down–due to either logoff or Windows shutdown. You can cancel the shutdown sequence.
* You can add custom code for any of these events by just overriding the OnEventName method in your Application-derived class, e.g. OnStartup.
What is the series of Window Events at Startup in WPF?
* At application startup, the Window events that are fired (in order) for the main window are:
1) Initialized - Main window is being created
2) IsVisibleChanged - IsVisible property set to true
3) SizeChanged - Size property set to size of window
4) LayoutUpdated - Window layout changes
5) SourceInitialized - Window is attached to Win32 window handle
6) Activated - Window becomes foreground window
7) PreviewGotKeyboardFocus - Window getting focus
8) IsKeyboardFocusWithinChanged - IsKeyboardFocusWithin property set to true
9) IsKeyboardFocusedChanged - IsKeyboardFocused property set to true
10) GotKeyboardFocus - Window now has keyboard focus
11) LayoutUpdated - Window layout changes
12) Loaded - Window is now laid out, fully rendered
13) ContentRendered - All window content has been rendered
What is the series of event fired for application shutdown in WPF?
1) Closing - Window is going to close
2) IsVisibleChanged - IsVisible property set to false
3) Deactivated - Window becomes background window
4) IsKeyboardFocusWithinChanged - IsKeyboardFocusWithin property set to false
5) IsKeyboardFocusedChanged - IsKeyboardFocused property set to false
6) LostKeyboardFocus - Window no longer has keyboard focus
7) Closed - Window is closing
How to Creating Windows Forms Controls Dynamically in WPF?
1) Import the following namespaces:
using System.Windows.Forms;
using System.Windows.Forms.Integration;
2) Create the windows forms control and set its properties and event handlers.
3) Add the control to the 'Child' property of 'WindowsFormsHost' object.
4) Add the host object to the 'Children' collection of the panel.
How to host WPF Controls in Windows Forms?
1) Add reference to the following:
a) Presentation Core
b) Presentation Framework
c) WindowsBase
d) WindowsFormsIntegration
e) System.Xaml
2) Also add reference to the WPF control DLL.
3) Use the 'ElementHost' control in 'WPF Interoperability' tab in Toolbox to host WPF controls.
What is EventAggregator?
A service that is primarily a container for events that allows publishers and subscribers to be decoupled so they can evolve independently. This decoupling is useful in modularized applications because new modules can be added that respond to events defined by the shell or other modules.
What is multi-targeted code?
Code that targets two different platforms with largely the same code-base. This allows binaries targeting two different technologies to be produced while keeping the code as much the same as possible. The technologies that Prism helps in multi-target are Windows Presentation Foundation (WPF) and Silverlight.
What is a Region in Prism?
A named location that we can use to define where a view will appear. Modules can locate and add content to a region in the layout without exact knowledge of how and where the region is visually displayed. This allows the appearance and layout to change without affecting the modules that add the content to the layout.
What is Region Manager in Prism?
The class responsible for maintaining a collection of regions and creating new regions for controls.The RegionManager finds an adapter mapped to a WPF or Silverlight control and associates a new region to that control. The RegionManager also supplies the attached property that can be used for simple region creation from XAML.
What is Separated Presentation pattern?
Pattern used to implement views, which separates presentation and business logic
from the UI. Using a separated presentation allows presentation and business logic to be tested independently of the UI, makes it easier to maintain code, and increases re-use opportunities
What is View Discovery in Prism?
A way to add, show, or remove views in a region by associating the type of a view with a region name. Whenever a region with that name displays, the registered views will be automatically created and added to the region.
1
2
3
4
More WPF Exclusive Interview Questions & Answers here
Found this useful, bookmark this page to the blog or social networking websites.
Bookmark It
Interview Questions and Answers Categories
.NET Certifications
.NET Core
.NET Framework
ADO.NET
AI ML
Android
Angular
AngularJS 1x
Aptitute Test
ASP.NET
ASP.NET AJAX
ASP.NET Core
ASP.NET MVC
ASP.NET Web API
Aurelia
Azure
Best Practices
BizTalk Server
Bootstrap
C#
Cloud
CMS
CSS 3
Data Structures & Algorithms
Design Pattern & Practices
DotNetFunda.Com
Entity Framework
Error and Solution
F#
Function Points (FPA)
HR
HTML 5
IIS
Interview Questions
JavaScript
jQuery
Kinect
LightSwitch
LINQ
Management
Mobile Development
MSBI (SSIS, SSRS, SSAS)
Mule
Networking
News and Community
Node.js
NoSql
OOPS
Oracle
Others
PostgreSQL
PowerShell
Product Reviews
Project Management
Python
QA (Testing)
R Language
Regular Expressions
SEO
SharePoint
SignalR
Silverlight
Sql Server
TypeScript
UML
VB.NET
Visual Studio
WCF
Web Analytics
Web Services, Remoting
Windows 8
Windows Forms
Windows Metro
Windows Phone
WPF
WWF
XML