Mastering Visual Studio 2017
上QQ阅读APP看书,第一时间看更新

Building Applications for Windows Using XAML Tools

The Windows Presentation Foundation (WPF) provides developers a unified programming model to build dynamic, data-driven desktop applications for Windows. It supports a broad set of features that includes application models, controls, layouts, graphics, resources, security, and more. It is a graphical subsystem for rendering rich UI (User Interfaces) and is part of the .NET Framework, which was first released along with .NET 3.0.

The WPF is a resolution-independent framework that uses vector-based rendering engine using the eXtendable Application Markup Language (XAML) to create stunning user interfaces.

The runtime libraries for it to execute are included with Windows since Windows Vista and Windows Server 2008. If you are using Windows XP with SP2/SP3 and Windows Server 2003, you can optionally install the necessary libraries.

In this chapter, we will discuss on the following points and start building Windows applications using the WPF framework:

  • The WPF architecture
  • The XAML overview
    • Object element syntax
    • Property attribute syntax
    • Property element syntax
    • Content syntax
    • Collection syntax
    • Event attribute syntax
    • Understanding the XAML namespaces
    • Working with inline code in XAML pages
    • The code behind file of an XAML page
  • Build your first WPF application
    • Get started with WPF project
    • Understanding the WPF project structure
    • Get familiar with XAML Designer
    • Adding controls in XAML
    • Command-line parameters in WPF application
  • Layouts in WPF
    • Using Grid as a WPF panel
    • Using Stack Panel to define stacked layout
    • Using Canvas as a panel
    • Using WPF Dock Panel to dock child elements
    • Using the WrapPanel to automatically reposition
    • Using UniformGrid to place elements in uniform cells
  • WPF property system
  • Data binding in WPF
  • Using Converters while data binding
  • Using triggers in WPF
    • Property trigger
    • Multi trigger
    • Data trigger
    • Multidata trigger
    • Event trigger