9.20. Create a Windows Presentation Foundation Application

Problem

You need to create a Windows Presentation Foundation (WPF) application using only managed code (no XAML).

Solution

Create an instance of the System.Windows class, and use an instance of the System.Windows.Application to display it.

How It Works

As mentioned in the introduction to this chapter, WPF is a new format for creating Windows-based applications that uses an approach similar to ASP.NET. The front end is written using XAML, and many tools are available for visually designing it and outputting XAML. The back end is handled by managed code.

Although what we've just described is how WPF is meant to be used, it is still possible to create a WPF application completely using ...

Get Visual Basic 2008 Recipes: A Problem-Solution Approach 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.