What is WPF?

Windows Presentation Foundation(WPF) is a development framework used to create a desktop application. It is a part of the .NET framework. The WPF has a resolution-independent and vector-based rendering engine which is helpful to deal with modern graphics hardware. The latest version of WPF is 4.6. In this framework, UI of the application is designed in XAML language and Application logic is Written in C# programming language.

Features of WPF are as following:

  • Extensible Application Markup Language (XAML)
  • Controls
  • Data Binding
  • Layout
  • 2D and 3D graphics
  • Animation
  • Styles
  • Templates
  • Documents
  • Media
  • Text
  • Typography

WPF Architecture: The major components of the WPF are PresentationFramework, PresentationCore, Milcore, Common Language Runtime(CLR), User32, Kernel. Milcore is written in unmanaged code in order to enable tight integration with DirectX, which is responsible for display. WPF has fine control over memory and execution. The composition engine in milcore is extremely performance-sensitive and required giving up many advantages of the Common Language Runtime to gain performance.



Creating a WPF Application Using Visual Studio 2019

Step 1: Open Visual Studio and select Create a new project under the Get started menu. The Create a new project dialog opens. Select the WPF App (.NET Framework) template and then select Next.

Create a new peoject dialog box

Step 2: The Configure your new project dialog opens. Enter the project name IntroductionToWPFApplication and then select Create.

Configure your new project dialog box

Visual Studio creates the project and opens the designer for the default application window named MainWindow.xaml.

MainWindow.xaml