Academic Company Events NI Developer Zone Support Solutions Products & Services Contact NI MyNI

Document Type: Instrumentation Newsletter
NI Supported: Yes
Publish Date: Nov 7, 2012


Feedback


Yes No

Related Categories

Related Links - Developer Zone

Related Links - Products and Services

Microsoft WPF: The Future of .NET UI Design

6 ratings | 3.17 out of 5
Print | PDF

NI introduces a new suite of Measurement Studio user interface controls for the next generation of GUI design.

Introduction to Windows Presentation Foundation

In recent years, sophisticated consumer products such as smartphones have elevated the standard for what is considered a good software user experience. Given that UI expectations will continue to grow, developers must find ways to incorporate better design, multitouch capabilities, and advanced graphics into their desktop application UI to meet mounting demands. Prior to WPF, anything more advanced than a WinForms GUI would require stitching together multiple Windows technologies, making development lengthy and difficult.

Application users can easily interpret data correctness using interactive WPF graph controls.

To meet such challenges, Microsoft created Windows Presentation Foundation (WPF) as a premier technology for building Windows client applications with immersive and intuitive user experiences. This UI framework is a subset of the .NET framework and was first introduced as part of .NET 3.0 to help developers meet increasing expectations in the experience and usability of software applications. WPF combines the application UI, 2D and 3D graphics, documents, and multimedia into one single framework to help .NET developers create rich and interactive applications. The framework facilitates the creation of high-quality UIs that stand out among competitors and help software operators accomplish their tasks faster. WPF also provides developers with the tools they need to more rapidly iterate and reach a better quality UI in a shorter amount of time.

WPF is similar to its predecessor Windows Forms, but differs fundamentally in that it builds on top of DirectX, a technology that originally focused on multimedia and game programming. This adds the ability to implement advanced visuals such as animated graphics, videos, or immersive 3D environments as well as take advantage of hardware acceleration when it is available.

The WPF programming model is similar to ASP.NET web development with the “code behind” approach. It should also be noted that WPF was not created to replace Windows Forms for every application because there are still cases where Windows Forms are adequate. Rather, WPF will continue to grow in popularity as a modern UI design tool and must be considered for any application that needs a richer user experience.

Separation of Design and Business Logic Through XAML

The WPF framework lets developers decouple visual behavior from the underlying program logic through the eXtensible Application Markup Language (XAML)—pronounced “zammel.” XAML is a new language that provides a declarative model for application programming. With this new markup, UIs can be defined without the need to program, which is similar to creating an HTML web page. Like Windows Forms, WPF forms are built using the interactive designer to drag and drop items on the UI and customize in the properties box. Unlike Windows Forms applications for which the designer generates code in C# or Visual Basic .NET (VB .NET) to create controls on the form, the interactive designer generates a XAML script in a WPF application.

With XAML, developers can create a workflow where separate parties can work on the UI and the business logic of an application, potentially using different tools. For example, a graphics designer or usability expert can specify how a UI should look and interact using a tool such as Microsoft Expression Blend. Then a developer can import that XAML description into a tool such as Microsoft Visual Studio and write the C# or VB .NET program logic. Because of this, developers, graphics designers, and usability testers can work in parallel with quicker iteration to converge on a higher quality UI faster than previous UI stacks would allow.


[+] Enlarge Image

The XAML layer allows user interface developers and program logic developers to work in parallel and focus on their skill strengths.

Technical Features of WPF

  • WPF provides a single, unified solution so that creating and maintaining applications becomes less expensive because programmers are required to learn only a single framework.
  • WPF fully exploits the power of the graphics processing unit on a system by offloading as much work as possible to the hardware.
  • WPF features a multitouch interface that greatly simplifies programming complex touch interactions.
  • The vector-based rendering engine makes the UI faster, scalable, and resolution independent.
  • Styles and templates allow for simplified reuse of components and UI properties.
  • The WPF framework delivers a completely new event-handling technology that uses a message routing system, thus eliminating the need for multiple message loops.

NI Measurement Studio WPF Controls for Test and Measurement

Within test and measurement applications, data collection is followed by processing and visualization. The developer must design an informative UI that helps software operators easily manipulate an application and make important decisions based on the data displayed to them.

The NI Measurement Studio suite of tools and class libraries includes engineering-specific WPF controls such as buttons, sliders, knobs, and switches that mimic the look and behavior of physical lab instrumentation to create an intuitive UI experience. Measurement Studio WPF graphs and charts plot signal data so that an operator can understand the trends, behavior, and correctness of the systems being measured or tested. This suite also includes gauges, meters, and scales to represent numerical values so that the user can easily interpret whether a value fits within expected limits. Developers can use these tools and the Measurement Studio signal processing libraries within the Microsoft Visual Studio development environment alongside built-in Microsoft WPF controls to quickly create and deploy complete test and measurement systems. Measurement Studio supports WPF in Microsoft Visual Studio 2010 and later.

Learn more. 

Anna Kozminski 
Anna Kozminski is a product marketing engineer for software at National Instruments.

This article first appeared in the Q4 2012 issue of Instrumentation Newsletter.

6 ratings | 3.17 out of 5
Print | PDF

Reader Comments | Submit a comment »

 

Legal
This material is protected under the copyright laws of the U.S. and other countries and any uses not in conformity with the copyright laws are prohibited, including but not limited to reproduction, DOWNLOADING, duplication, adaptation and transmission or broadcast by any media, devices or processes.