hello-world-wpf-step-by-step-Mainwindow.xaml

Hello World – WPF Tutorials Step by Step – 1

Hello World – WPF Tutorials Step by Step- 1

From today I will upload WPF tutorials step by step gradually. So who ever wants to learn WPF from scratch or I can say from Beginning to Intermediate or Advance, one can follow this blog.

Today I will cover how we can setup project in WPF and explain basic folder structure of WPF project. In Prerequisite we would require Visual Studio 2013 with Framework 4.  You could also download Visual Studio 2013 Express windows version from here.  Follow below steps to setup new project

Step 1: Start Visual Studio and Click on New Project

hello-world-wpf-step-by-step-1

Step 2 : Would have below landing window

hello-world-wpf-step-by-step-Landing-window

Step 3: Solution Explorer

hello-world-wpf-step-by-step-solution-explorer

As per the architecture of project is there is App.xaml, which contains details of landing page and other UI related general settings like we are used to do in css files in web applications.

Step 4: MainWindow.xaml

hello-world-wpf-step-by-step-Mainwindow.xaml

 

xmlns=”http://schemas.microsoft.com/winfx/2006/xaml/presentation”
xmlns:x=”http://schemas.microsoft.com/winfx/2006/xaml”

The first declaration maps the overall WPF client / framework XAML namespace as the default and second declaration maps a separate XAML namespace, mapping it (typically) to the x: prefix

Step 5: MainWindow.xaml.cs

hello-world-wpf-step-by-step-Landing-MainWindow.xaml.cs

Advantages with WPF are as below:

  1. Data Binding
  2. UI customization
  3. Separation between UI and Logic
  4. Easier implementation of MVVM pattern
  5. Plenty no of controls available to achieve different functionality
  6. Could run on Browser as well

Leave a Reply