WPF - SPLessons
SPLessons 5 Steps, 3 Clicks
5 Steps - 3 Clicks

WPF What is WPF

What WPF?

shape Description

WPF (Windows Presentation Foundation) supports developing the applications similar to Windows Form Applications as well as with XAML based environment i.e. flexibility is available to create with XAML support and with normal traditional windows forms support.

Creating WPF Application

shape Step-1

First open "Visual studio".Click on File-> New -> Project

shape Step-2

Double click on Visual C# from installed templates.Select the WPF application->Type the Application Name ->Click on OK.

shape Step-3

After click on ok, then the WPF application is created. The application becomes like below screen:

shape More Info

Every WPF Application will contain some set of user interfaces called Windows.
  • In every window, within WPF application, a class can be created and it is inherited from System.windows.window class.
  • For every window created,  there are two files associated within Solution Explorer.
  1. .XAML
  2. XAML.CS

.XAML:

shape Description

.XAML is very much similar to .aspx file in asp.net.This file will contain two parts.One is Design part and another one is Source part.
  • Source part contains XAML design code for creating the user interface elements.
  • Design part will contain the respective physical appearance for the design code.

.XAML.CS

shape Description

.XAML.CS is similar to .aspx.cs file in asp.net and this will contain complete programming part code. In general, there is a hierarchy maintained within the window like below: