While console applications are great, they leave something to be desired. They are missing a graphical user interface or GUI for short. A GUI is an interface that the user can interact that has visual graphics such as buttons, icons, text, etc. In this tutorial, I will show you how to create an empty c# WPF application in Visual Studio 2015.
Let’s Get Started
First off you need to make sure that you have Visual Studio installed on your computer. I will be using Visual Studio 2015 for this tutorial, but older versions of Visual Studio should work just fine. For more information regarding Visual Studio take a look at my post Getting Started with Visual Studio.
To create a WPF application, open Visual Studio and you will be taken to the start screen. Click “New Project…” as shown in the image below or press control + shift + n to create a new project.
You will be taken to a new project dialog where you will choose “WPF Application” under Templates – Visual C# – Windows as shown below.
After giving your application a name, click “OK”. A new WPF application project is created with the name your provided. You should see a designer window with the xaml code for the window as shown below.
In the solution explorer, you will see there is a code behind for the xaml which is named “MainWindow.xaml.cs”. It will look like the screenshot below.
If you run the application in debug mode, you will see that the blank MainWindow shown in the designer is displayed as shown below.
Congratulations! You now have a blank WPF application to do whatever you want. Now it’s time to start making applications with a GUI. If you need help getting started, be sure to check out my other c# walkthroughs.