When should I use WPF instead of DirectX?
DirectX is definitely not dead and is still more appropriate than WPF for advanced developers writing hard-core “twitch games” or applications with complex 3D models where you need maximum performance. That said, it’s easy to write a naive DirectX application that performs far worse than a similar WPF application. DirectX is a low-level interface to the graphics hardware that exposes all of the quirks of whatever GPU a particular computer has. DirectX can be thought of as assembly language in the world of graphics: You can do anything the GPU supports. WPF provides a high-level abstraction that takes a description of your scene and figures out the best way to render it, given the hardware resources available. Internally, this might involve using Shader Model 3.0, or the fixed-function pipeline, or software. (Don’t worry if you’re not familiar with these terms, but take it as a sign that you should be using WPF!). The downside of choosing DirectX over WPF is a potentially astronomical increase in development cost. A large part of this cost is the requirement to test your application on each driver/GPU combination you intend to support. One of the major benefits of building on top of WPF is that Microsoft has already done this testing for you! You can instead focus your testing on low-end hardware for measuring performance. The fact that WPF applications can even leverage the client GPU over Remote Desktop or in a partial-trust environment is also a compelling differentiator.
What is XAML?
- It is Declarative Markup Language.
- It simplifies creating a UI for a .NET Framework application.
- It can create visible UI elements in XAML , and then separate the UI definition from the run-time logic by using code-behind files. This joined to the markup through partial class definitions. XAML represents the instantiation of objects in a special set of backing types defined in assemblies.
- It enables a workflow where separate parties can work on the UI and the logic of an application, using different tools. ex: Expression Blend and Visual Studio
- It is Visual designer to create User friendly UI
- XAML is not dependent on WPF or WPF is not dependent on XAML. WPF Designed to be XAML Friendly
Senior WPF interview questions
- Example of attached behavior?
- What is PRISM,CAL & CAG?
- How can worker threads update the UI?
- WPF 3D - Added by a7an
- Differences between Silverlight 2 and WPF
- MVVM/MVP - Added by a7an
- WPF Performance tuning
- Pixel Shaders
- Purpose of Freezables
What is WPF ? Why it is used?
WPF is Object Oriented , XAML based.
- It Uses DirectX Engine for rendering GUI
- It do not use GDI 32 programming at all as opposed to Win32 applications
- It do not require more time or cost for graphics, drawing or animation programming
- It is Easy to change resolution unlike win32 application
- It is XAML Friendly.
- It has .NET API that has integrated to XAML (Xtensible Application Markup Language)
- Easily select the Controls unlike Win32 Controls.
- It has the ability to create 3D graphics in windows apps
- It contains Separate API for graphics and animation
- Most powerful Windows UI Framework
It is used for the
- For the better User Interface & the Design
- Customization of Controls
- Integrating Flash, Direct, Win32, Windows Forms
- For Generic consistency professional look (Using Styles like CSS in Web)
Mid-level WPF interview questions
Routed Events & Commands
Converters - Added by Artur Carvalho
Explain WPF's 2-pass layout engine?
How to implement a panel?
Interoperability (WPF/WinForms)
Blend/Cider - Added by a7an
Animations and Storyboarding
ClickOnce Deployment
Skinning/Themeing
Custom Controls
How can worker threads update the UI?
DataTemplate vs HierarchicalDataTemplate
ItemsControl vs ItemsPresenter vs ContentControl vs ContentPresenter
Different types of Triggers
WPF Interview Questions
1. What is WPF ? Why it is used?
2. What is XAML?
3. What is Dispatcher Object?
4. What is Dependency Object?
5. What is the architecture of WPF?
6.What is are Types of events and Event Routing or a Routed Event?
7. What is difference between Event Bubbling vs Event Tunneling? When to apply what?
8.What are difference between Win-Forms and WPF?
9. What are different types of Panels in WPF ?Explain them?
10.What is difference between StackPanel, DockPanel, WrapPanel and Grid?
11.What are Primitive Controls and Look Less Controls?
12.What are different important components to know in WPF? Explain them?
13. Why do you think WPF has more power?
14. What is difference between WPF and Web Applications which do you prefer? When to choose what?
15. Is Silverlight part of WPF or subset of WPF? What is difference between WPF and Silverlight
16. What is the class name from which all WPF objects are derived from?
17. How did you create Dependency Object?
18. How did you implement Dependency Property?
19. What is PRISM ? What are its advantages of using it in real time applications?
10. How did you install and implement PRISM in real-time applications?
Basic WPF interview questions
- Strong .NET 2.0 Background & willing to learn!
- Explain dependency properties?
- What's a style?
- What's a template?
- Binding
- Differences between base classes: Visual, UIElement, FrameworkElement, Control
- Visual vs Logical tree?
- Property Change Notification (INotifyPropertyChange and ObservableCollection)
- ResourceDictionary - Added by a7an
- UserControls - Added by a7an
- difference between bubble and tunnel routing strategies - added by Carlo
- Why did Microsoft introduce yet another markup language?
- XAML