Skip to main content

Command Palette

Search for a command to run...

Learning WPF: Creating Projects

Updated
2 min read
Learning WPF: Creating Projects
R

I am a recent graduate at the beginning of my software development career. I enjoy documenting my learnings through my blogs

I have just begun my journey using WPF with C# in Visual Studio code. This is my first venture into WPF and I aim to document all of my learnings in a blog series. I have previously been using basic C# and outputting to a console using console applications.

What is WPF?

WPF or Windows Presentation Foundation is a type of framework that will create a desktop client application. From what I have gathered so far, it appears to be a more visual method of creating code. The user interface (UI) of this type of application is written using the XAML language which I would compare to HTML. The logic of the application is written in the C# programming language which again is similiar to JavaScript..

Setting up a new project in Visual Studio…

I started by creating a new template using visual studio, the template I used for this was WPF App (.NET Framework) with C#.

Step 1. Choose the template for your project, in this case, it will be WPF App (.Net Framework) C#. See the image below for the template to use.

Step 2. Setting up your new project, by naming the project and saving it to a location. See the image below:

What you will see...

When you have your project created you will have two types of files available. The first is a XAML file, which is like the HTML of your file, or design.

You will also find a C# file either already open as a tab at the top, or you can look for this in the solution explorer, in the dropdown of the MainWindows.xaml file.

This is how you create a project using WPF in C#, I will follow up with my next learnings of using creating applications and learning how to use the tools in the program.

What I learnt...

Today I learnt the basics of WPF, what WPF is and how to set up a WPF program. Once I had set up the program it was clear to me that WPF is both C# based and something very similar to HTML. In my head, it is a more visual way to code and the next step in my learning journey.