30 Styling XAML Apps

What’s In This Chapter?

  • Styling for WPF and UWP Apps
  • Creating the base drawing with shapes and geometry
  • Scaling, rotating, and skewing with transformations
  • Using brushes to fill backgrounds
  • Working with styles, templates, and resources
  • Creating animations
  • Visual State Manager

Wrox.com Code Downloads For This Chapter

The wrox.com code downloads for this chapter are found at www.wrox.com/go/professionalcsharp6 on the Download Code tab. The code for this chapter is divided into the following major examples:

  • Shapes
  • Geometry
  • Transformation
  • Brushes
  • Styles and Resources
  • Templates
  • Animation
  • Transitions
  • Visual State


In recent years, developers have become a lot more concerned with having good-looking apps. When Windows Forms was the technology for creating desktop applications, the user interface didn’t offer many options for styling the applications. Controls had a standard look that varied slightly based on the operating system version on which the application was running, but it was not easy to define a complete custom look.

This changed with Windows Presentation Foundation (WPF). WPF is based on DirectX and thus offers vector graphics that allow easy resizing of Windows and controls. Controls are completely customizable and can have different looks. Styling of applications has become extremely important. An application can have any look. With a good design, the user can work with the application without the need to know how to use a Windows application. ...

Get Professional C# 6 and .NET Core 1.0 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.