Skip to main content
main-content

Über dieses Buch

Windows Presentation Foundation is Microsoft's API for creating Windows applications. It gives the programmer the ability to produce dazzling, graphics–rich programs easily without having to delve into the messy details of the graphics subsystem.

To use this power, however, the programmer must learn new concepts for laying out pages and displaying graphics. Illustrated WPF presents these concepts clearly and visually—making them easier to understand and retain.

Inhaltsverzeichnis

Frontmatter

Chapter 1. Introduction to Windows Presentation Foundation

Windows Presentation Foundation (WPF) is a platform for developing and running visually rich .NET programs. It consists of two elements:
  • A set of DLLs designed for creating Windows programs with the following characteristics:
    • Richly visual user interfaces
    • Strong and extensive data binding
  • A public application programming interface (API), allowing our programs to access those DLLs and use their powerful capabilities

Chapter 2. Overview of WPF Programming

WPF programming is a large topic with lots of areas to cover. Most of the chapters in this book address one or two topics and cover them in detail. This chapter and the next, however, are different. In these chapters, I’ll cover a number of topics that will lay the groundwork for the rest of the text.

Chapter 3. WPF Architecture and Applications

The previous chapter was a gentle introduction to the WPF programming framework and the mechanics of building a program using just C#. In this chapter, I’ll cover more of the architecture of WPF and introduce the XAML markup language.

Chapter 4. XAML

One of the most important concepts of WPF is that the user interface is a tree of WPF class objects. That tree has a single node at the top, and each node in the tree can have zero or more child nodes.

Chapter 5. Layout

Before WPF, user interfaces generally consisted of windows with statically placed controls. The programmer set the height and width of a control and placed it at a certain coordinate position on the window or panel, where it stayed. (To be fair, you could also dock controls to edges.)

Chapter 6. Content and Controls

WPF is a UI framework that excels in displaying visual content. In previous frameworks, different UI controls were specialized for particular purposes, and their visual presentations were more or less fixed. For example, a Label in the Windows Forms framework was a piece of static text. A Button was usually labeled with text but could also paint its background with an image.

Chapter 7. Dependency Properties

You might have noticed by now that WPF uses properties extensively. The WPF classes have been specifically designed to use properties rather than methods, when possible, because properties are declarative, making them ideal for XAML’s declarative syntax. But beyond just the preference for properties, WPF has produced a whole new way of using properties and a set of services to support that method.

Chapter 8. Data Binding

Oftentimes a visual element displays the representation of some underlying data value. In this case, you usually want to ensure that the visual element stays up-to-date and changes when the underlying data value changes.

Chapter 9. Routing Events and Commands

Windows programming is event driven, which means that while a program is running, it can be interrupted at any time by user actions or system actions such as button clicks, key presses, or system timers. When this happens, the program needs to handle the event and then continue on its course. If you want your program to perform some set of tasks when a particular event occurs, you must write a method, called an event handler, to be called when the event occurs.

Chapter 10. Other Controls and Elements

In Chapter 6, you learned about many of the most important WPF controls that present content. In this chapter, you’ll learn about other controls and elements you’ll need to have a rich and smoothly functioning application. You’ll start with the TextBox control and continue to menus, toolbars, and miscellaneous other elements.

Chapter 11. Resources

WPF uses the term resource to refer to two different types of things:
  • The first type of resource refers to items used by the program that aren’t created by the program’s source code. These include, for example, images or icons that are supplied from outside the code.
    • These are resources in the common sense of the term as it’s been used since the beginning of Windows programming.
    • These are also called assembly resources or binary resources if they are compiled into the binary.
  • WPF also uses the term in a new way, to describe .NET code objects that are stored in an object dictionary and then used at various places throughout the code.
    • These are usually associated with XAML markup but can also be used in the code-behind.
    • These are also called logical resources, object resources, or XAML resources.

Chapter 12. Styles

In the previous chapter, you saw how to declare and save the value of a dependency property as a logical resource in a resource collection. Once the resource is declared, you can then use it anywhere below the declaration in the element tree, without having to re-define it each time. Also, if you need to change the value of the property, you can do it in just one place, and the change is reflected in all the locations that use it.

Chapter 13. Control Templates

One of the major features of WPF is that it allows you unprecedented control of the way your applications looks. This extends even to the appearance of the standard controls.

Chapter 14. Page Navigation Programs

Most normal Windows programs start by showing the user a single main window. The user can then click buttons on the window or select menu items, and the program opens additional windows, which present the user with additional options or data.

Chapter 15. More Data Binding

In Chapter 8 you saw how to bind a control to a collection of data objects. In Chapter 13 you saw how to replace the default appearance of a control with an appearance of your own design. In this chapter, I’ll combine and extend these two concepts and show you how to specify the appearance of data you’ve mapped to a control.

Chapter 16. Trees, Tabs, and Other Controls

In this chapter, I’ll cover two important controls that weren’t covered in the previous chapters: TreeView and TabControl. I’ll also cover the three new controls included in WPF 4.0, which is scheduled for release shortly after the release of this text.

Chapter 17. Text and Documents

WPF allows programmers to design programs with amazing graphic content with unprecedented ease. Text, however, still plays an important part in most programs and can even be the dominant component of some. Programs can use different amounts of text and use it in very different ways. In this chapter, you’ll learn some of the ways WPF provides for presenting text.

Chapter 18. Graphics in WPF

As you’ve seen throughout this text, WPF is a much more graphics-oriented framework than any previous Windows development framework. So far, I’ve covered graphics piecemeal, in the context of whatever topic I was covering at the time. In this chapter, I’ll cover graphics from a higher perspective and show how various graphics features apply across WPF as a whole.

Chapter 19. Animation

A graphic animation, such as an animated cartoon, is a sequence of frames, where the objects in each frame are moved just a small bit from where they were in the previous frame. When the frames are shown in rapid succession, the objects in the frames appear to be moving.

Chapter 20. Audio and Video

In most of the areas I’ve covered throughout this text, WPF allows the programmer far more expressiveness than in previous frameworks. The audio features it provides, however, aren’t particularly impressive. Instead, they are little more than wrappers around Win32 APIs or the Windows Media Player.

Backmatter

Weitere Informationen

Premium Partner

BranchenIndex Online

Die B2B-Firmensuche für Industrie und Wirtschaft: Kostenfrei in Firmenprofilen nach Lieferanten, Herstellern, Dienstleistern und Händlern recherchieren.

Whitepaper

- ANZEIGE -

Best Practices für die Mitarbeiter-Partizipation in der Produktentwicklung

Unternehmen haben das Innovationspotenzial der eigenen Mitarbeiter auch außerhalb der F&E-Abteilung erkannt. Viele Initiativen zur Partizipation scheitern in der Praxis jedoch häufig. Lesen Sie hier  - basierend auf einer qualitativ-explorativen Expertenstudie - mehr über die wesentlichen Problemfelder der mitarbeiterzentrierten Produktentwicklung und profitieren Sie von konkreten Handlungsempfehlungen aus der Praxis.
Jetzt gratis downloaden!

Bildnachweise