Windows Presentation Foundation (WPF) is a very powerful tool to create rich desktop applications. Its innovative features like hardware acceleration and resolution independence really elevates the quality of the application. WPF not only just improves the graphics of the application but it also improves the performance and quality of the application with its amazing features. So, here are 5 most important reasons to go for WPF to create a desktop application.
1. Hardware Acceleration:
WPF uses Direct X as its graphics technology instead of GDI/GDI+ libraries. All desktop application development platforms like win forms work on GDI/GDI+ libraries. All the drawing in the application is dependent on the graphics technology. DirectX was designed to work efficiently with the video cards and handle hardware acceleration.
Now, WPF using DirectX improves the performance of the application to a great extent. By using hardware acceleration, the work gets offloaded from computer’s main processor (CPU) to video card processor (GPU). Thus, giving the CPU the time to work on other operations.
1. Disable View State Of A Page If Possible:
Page that does not require any post back events can have the view State off. By default the “ViewState” property is enabled, we can disable it in two ways:
(a) At control level: by set EnableViewState property to false
(b) At page level: using <%@ Page EnableViewState=”false” %>
Advantage: It decreases the memory allocation on server.
2. Use of String Builder For Concatenation:
All operations we do on strings are stored in memory as separate references. When we modify our string, at run time it returns a new string, leaving the previous string as garbage collected. To stop creation of new references we should use string builder whenever concatenation is required.