Background
From a long time in software development world it was assumed that Desktop applications will be dead. This dodo was there more than half of decade. But it’s not the reality because the LOB (Line Of Business) applications are still heavily used as desktop applications in various businesses e.g. Reporting, Data analytics or simple data entry form application. Talking of desktop application comes with talking about Windows forms and WPF.
Windows Forms and WPF
Windows forms have stayed as part of the softwares for a long time now they have been upgraded to WPF because of better UI and great user experience. Now the WPF have been in the market and it’s a long time now. Developers were afraid that some other technology will soon be in the market to replace the WPF. It was obvious because we didn’t hear anything related to WPF from Microsoft. But Finally, We have some news and updates from Microsoft which will give a great relief to Developers and Businesses. Because this time we have great enhancement done in WPF. In this blog post will be discussing those important changes done that will change the experience of WPF in terms of performance(A lot of requests were raised regarding the performance).
Improvements in WPF with .Net 4.6 and Visual studio 2015:
1. Profiling on the go
Now one can start profiling of WPF application. The profiler provides flexibility to choose either one or both between the CPU usage and Memory usage.
To Launch a profiler Go to Debug –> Start Diagnostic tool without debugging... (In previous post we discussed that Diagnostic tool is now part of the Debugging process)
Here’s a preview of how the diagnostic would look like:
This might look like something like this when you select the options to diagnose and start diagnosis:
When you stop the diagnosis it’ll generate the reports for each type of diagnosis selected.
These reports will contain the “Worker Thread” state, CPU usage and memory usage including the Hot Paths. To learn reading these report see MSDN detailed article.
2. Dynamic UI diagnostic tool
Those who worked extensively on WPF apps knows the pain of debugging the UI. That time there were tools used to debug the UI stuff. Now this “Most Wanted” feature is now can be found in Visual studio 2015. The enhancements are not just spying but giving the flexibility to change the Live UI items while running and debugging the application is Just made is “Awesome”.
The diagnostic tools are known and available as “Live Visual Tree” and “Live Property Explorer”. To enable this tool go to “Debug” menu item while debugging and goto Debug –> Windows –> Live Visual Tree.
Now you can see following windows. There are options to Enable/Disable the dynamically finding the UI elements from the UI and changing the properties accordingly. Awesome stuff “Try it yourself”.
This will change a lot of things and will help speeding up the development process.
3. XAML Editor vs Designer window
Developers are rarely use the designer window to design the component. Most of the time they’re relying on pure XAML coding stuff. Previously It was pretty annoying to have designer and XAML editor window together. Now you can “Turn off” the designer if you don’t like it there. Simply go to Tools –> Options –> XAML Designer. And turn it off by unchecking the Box.
I know you all must be liking these changes so far. This is not all there couple of more stuff that you can checkout and might help you with Development.
Here are couple of more items which are in the List which are shipped with .Net 4.6 and Visual Studio 2015 RTM:
4. Deferred/Lazy loading of Visual elements
5. UI Virtualization for data intensive applications
6. High Definition devices support
6. DirectX interoperability
7. Support of Modern device (Touch screen device)
8. Multi-image cursor file support in System.Windows.Input.Cursor
9. Support for transparent child windows.
10. Improved double tap gesture recognition by using common threshold distance from registry.
11. Improved text selection through double tapping the WPF TextBox control.
12. Improved reliability of stylus input for the WPF ComboBox control.
These are the improvements which can be posted as a dedicated blog posts so not discussing everything in this post. But future of WPF is bright with these enhancements. XAML and C# the combination is going to be there in the Market for long time.
For more details watch this Channel9 Interview with WPF team.
Note: These are the features which I liked most(out of those all shipped in RTM)and are are based on my own research.