Windows Presentation Foundation Masterclass
4.3 (1,696 ratings)
Course Ratings are calculated from individual students’ ratings and a variety of other signals, like age of rating and reliability, to ensure that they reflect course quality fairly and accurately.
9,294 students enrolled

Windows Presentation Foundation Masterclass

Leverage WPF with C# and XAML to build real world skills with Azure, REST, MVVM and Machine Learning
4.3 (1,699 ratings)
Course Ratings are calculated from individual students’ ratings and a variety of other signals, like age of rating and reliability, to ensure that they reflect course quality fairly and accurately.
9,294 students enrolled
Last updated 2/2020
English [Auto-generated], French [Auto-generated]
Current price: $69.99 Original price: $99.99 Discount: 30% off
5 hours left at this price!
30-Day Money-Back Guarantee
This course includes
  • 20 hours on-demand video
  • 1 article
  • 2 downloadable resources
  • Full lifetime access
  • Access on mobile and TV
  • Certificate of Completion
Training 5 or more people?

Get your team access to 4,000+ top Udemy courses anytime, anywhere.

Try Udemy for Business
What you'll learn
  • Be able to build desktop apps that leverage WPF
  • Be able to create your own cloud services
  • Learn languages and patterns that open up opportunities to create iOS, Android and UWP applications using Xamarin
  • Learn to better structure your code for easier maintenance, better code reuse, and greater compatibility with other projects (such as Xamarin and UWP)
  • Build your own app from start to finish including its cloud services such as databases and file storage
Course content
Expand all 131 lectures 20:02:22
+ Intro to WPF
4 lectures 24:42

In this lecture you will learn about the basic way in which a WPF app is structured, and how one has to code it, as well as learn about the requirements to start developing apps for this platform.

Preview 06:56

In this lecture you will prepare the IDE on your Windows computer for it to support Windows Presentation Foundation development, by installing Visual Studio Community 2017 and Blend for Visual Studio.

Preview 04:23

In this lecture you will create your first WPF project, and learn about its structure, the way you will use the files, and how the XAML and C# MainWindow files are the ones to start using from the beginning.

The Structure of a WPF project

Create a Hello World app with WPF and test it directly on your Windows PC from Visual Studio 2017.

Hello World with WPF
+ XAML - The Calculator App
7 lectures 55:04
Learn about XAML, the markup language that you will use to define the interface, the resources, and the animations for your WPF applications.
What is XAML?

In this lecture you will start to use XAML a bit more, defining new types of elements into the UI, implementing StackPanels and testing the base functionality of Buttons and TextBoxes when running the app.

The XAML Syntax

Starting to define the values for the properties of XAML elements is crucial for the application to look better, and work better. In this lecture you will learn about a couple of value types that can be easily assigned through XAML code.

Setting Property Values

The Grid is one of the most powerful XAML elements, and in this lecture you will learn how to use it to sepparate the available space in columns and rows, as well as the three ways there are to define size, such as Auto and stars (*)

The Grid

In this lecture you will learn how the connection between XAML and C# can be established, so you can access XAML elements from C# to access, modify and set their values.

Communication with Code Behind

In this lecture you will take a look at the processes that are going on "backstage" that allow the XAML elements to be accessed from C#, understanding some of the autogenerated C# files and how partial classes work. How XAML works with g.i.cs files to get this done.

How XAML to C# Linking Works

In this lecture you will create your first event handler directly from XAML, and will understand how event handlers are executed when an event is fired.

Creating Event Handlers from XAML
+ C# - The Calculator App
7 lectures 01:02:06

In this lecture you will learn about some of the features of C#, ranging from how it is simple, modern and object oriented, to why it is considered type-safe.

The C# Language

In this lecture you will use the C# files a bit more, by creating event handlers with the help of Intellisense, Visual Studio's autocompletion tool, and coding the functionality for some of the buttons of the calculator.

Creating Event Handlers from C#

In this lecture you will continue to work with methods as event handlers for click events, but will now take a closer look at how they are defined. You will also assign one single event handler for multiple button's events, and learn how to identify which one triggered the event.

Working with Methods

In this lecture you will learn how to create your own custom types by using the enum and class keywords to create new classes and enumerators. You will also implement switch statements to complete the functionality of the calculator app.

Creating Custom Types

In this lecture you will perform some testing on your application, and identify a single scenario where the reult that is being displayed may not be the ideal.

Testing the App

In this lecture you will start to use a Message Box to display pop up alerts from your WPF application, varying from error alerts to warning alerts with sound and image included.

Displaying a Message Box

Our percentage button is working alright, however there are some scenarios when the result may not be the expected. So in this lecture I challenge you to try to resolve the described issue, before you take a look at the solution that I offer.

Percentage Challenge
+ Improving the UI with Resources and Styles
5 lectures 33:29

In this lecture you will start to style the buttons of the calculator, so it has some extra personality, by changing the background and forground colors,but we will also identify how inefficient doing it element by element is.

Styling XAML Controls

In this lecture you will start to implement static resources on your XAML Window, so you can reuse the definition of SolidColorBrush to apply throughout many elements and start defining more efficient XAML code.

XAML Static Resources

Now that you have used Static Resurces inside the Window, in this lecture you will learn to make those resources available throughout the entire application as global resources that are defined inside the App.xaml file.

Application-Wide Resources

Your XAML code is now more efficient, but there are still a lot of repetitions on your code when styling your controls, by implementing styles you will be able to implicitly establish styles to all those elements that are of TargetType without needing to add additional code.

Implicit Styles

Implicit styles apply automatically, but when you need more than one style for the same TargetType, it is time to define new styles with a Key attribute set up so they become explicit styles and can be assigne through StaticResources to the style property of a XAML element

Explicit Styles
+ Practicing C#
10 lectures 01:20:28

In this lecture you will create a new type of project from Visual Studio: a Console Project, that will allow you to focus on the C# language without having to deal with XAML. You will start to understand how these projects work by accessing the Console class and its WriteLine and ReadLine methods.

Creating a Console Project

Once you have your Console Proyect ready, you will start to practice defining variables, understand how the var keyword works, and how the scope of the variables is very important.

Variables and Scope

In this lecture you will get familiar with the use and definition of classes, as well as what namespaces are, how are they important, and why are they related to using directives. Also, you will start to create new using directives, which will be important to access code in other namespaces.

Classes and Namespaces

Time to define properties, another type of members for a class. Unlike methods, properties are not functionalities, but values, and serve as a way of protecting variables that should be private, without blocking the access to their values.

Properties of a Class

Objects, or instances of a class, are variables that are of a complex type. In this lecture you will define your own objects, that are of the types of the classes that you have created, and learn about static members, and accessing non static members.


In this lecture you will learn about inheritance, or how you can reuse the functionalities of one class on another related class, by making the second class a child class that can still behave like the parent class, and acces its members.


In this lecture you will learn how to define many different methods that are named the exact same way, but that have different signatures, and how to access different signatures from the same method. This is called method overloading.

Method Overloading

In this lecture you will learn how to redefine the functionality of a method that was inherited from another class, by marking the original method as virtual, and using the override keyword, in conjuction with the base keyword, to override the initial functionality of a method in child classes.

Method Overriding

In this lecture you will learn how to define interfaces that can help you extend the functionality of classes,even those which have already inherited from another class by defining new members that have to be later implemented.


Once you have defined an interface and the members that it will contain, it is time to implement the interface by implementing the functionality of its members. You will also learn how you can use an object as an interface, having access to the members defined inside that interface, no matter what type that object is.

Implementing an Interface
+ SQLite - The Contacts App
8 lectures 01:01:07

In this lecture you will create a second Window that will be a part of your WPF app, and will learn how, different to a Page, you can have multiple windows at once.

Working with Mode Windows

In this lecture, now that you have multiple windows, you will learn how to open them, how you can wait until they are closed before being able to return to a previous page (difference between Show and ShowDialog methods) and how to programatically close them.

Opening and Closing Windows

In this lecture you will prepare the WP project to start working with SQLite by adding the sqlite-net NuGet package as a reference inside it. This package will add functionalities for CRUD operations and connections to the SQLite database.

Adding SQLite

In this lecture you will create the model for the table that will be used inside the SQLite database by creating a class.This class will define the table, and its properties will define the columns.You will also define some SQLite attributes such as primarykey and autoincrement.

The Contacts Class

In this lecture you will learn about other SQLite attributes that will come in handy, such as the promatykey attribute, or the AutoIncrement, the MacLenght and the Ignore, all of these very usefull when constructing the tables and wanting to have a bit more control over how they get created.

More SQLite Attributes

In this lecture you will begin to isert new entries into a new SQLite database, by of course first creating a Table based entirely on the Model class, so it gets created with the necessary columns and the established attributes. You will learn how to establich connections to a database, and to create the database file.

Inserting into a Table

The using directive is useful, but it is not the only reason the using keyword exists, in this lecture you will learn about the using statement, its relationship with the IDisposable interface, and how it allows for a much more elegant way to solve the fact that we have to always close a SQLite connection.

The Using Statement

"}" data-sheets-userformat="{"2":769,"3":[null,0],"11":4,"12":0}">Now that you are inserting entries into a table, in this lecture you will learn to read them, by establishing more efficiently the connection with SQLite, and transforming a query into a List<T>

Reading from the Table
+ ListView
8 lectures 01:07:58

In this lecture you will create a ListView in XAML and start adding elements to it in two ways, by directly accessing the ListView's Items property and adding ListViewItems to it, and by setting the ItemsSource property to an IEnumerable.

Defining a ListView

In this lecture you will understand why an object, when displayed as a string, displays its namespace and type, and you will override the ToString method to implement custom functionality to it and make the ListView display useful information.

The ToString method

In this lecture you will learn about DataBinding and how it works, as well as hot it will let you bind two objects and their properties together in different ways, including OneWay, TwoWay, OneWayToSource and OneTime.

Intro to DataBinding

Using an ItemTemplate in this lecture will let you establish how each element on a ListView will look like, and will also teach you how to use DataBinding from an object in C# to many different properties on XAML by establishing a Data Context and a DataTemplate.

Using an ItemTemplate

This lecture will guide you as you implement the functionality to a search box inside the ListView to filter the contacts that are being displayed by those whose name match the one written in the box.

Filtering a List

The Language Integrated Query or Linq is a super powerful feature that you can use in C# to perform queries on lists, such as orderby, where, orderbydescending, distinct, and many others, this lecture teaches you the Where and OrderBy methods, as well as the full query language that you can use in C#

Deleting from the Table
Update the SQLite Table
+ Custom User Controls
3 lectures 31:54

In this lecture you will learn how to create a UserControl, or a control that will be customized to look and behave the way you need to, You will define its layout, and begin to create the functionality, before replacing the ItemTemplate with one of these.

Creating a Custom User Control

Once you have created a custom user control, in ths lecture you will learn how you can start using this inside any Page or Window by defining a namespace with the xmlns keyword, and replacing an ItemTemplate, however, you will also notice that Binding requires a dependency property of a dependency object.

Using Custom Controls

Binding to a Custom User Control, or implementing styling and animations for that matter, requires dependency properties. So in this lecture you will learn about dependency properties, how they are different from regular properties, how to use them and implement default functionality, for Binding to work.

Binding to a Custom Control - Dependency Properties
+ REST and AI
8 lectures 01:18:20

In order to learn to perform REST requests, we will use Microsoft's CustomVision API inside our WPF application, during this lecture you will learn how this easy service will allow you to integrate Artificial Intelligence in your application, even without the need to know a thing about AI.

Microsoft's CustomVision API

In this lectur eyou will take a look at how a CustomVision project from Microsoft is built, the way you classify the images, how the accuracy of the model is displayed, and how to test the AI. You will also create your own CustomVision API project.

Creating a Custom Vision Project

In this lecture you will upload the images and classify them, inside the CustomVision project, so the AI learns to identify one group from each other. After training the AI you will be able to test, directly from the website, how an image is classified, and receive results and probabilities for each tab.

Training the AI

In this lecture you will learn how to select a file from the local computer using WPF and the OpenFileDialog. You will learn how to help the user filter the type of elements that they should select, and to get an image file and display it inside an Image XAML element by assigning the file as a BitmapImage to the Source (ImageSource) of the Image element.

Selecting a File from the Computer

Once you have the image file path, in this lecture you will be able to create the entire HTTP request that needs to be sent to the service, following the CustomVision API's request, you will add the necessary headers, set the body to a byte array, configure the URL, and post a request to the REST service using HttpClient on a WPF app.

Sending a request to the REST Service

The service is going to respond once it has received the POST request, and the response is going to contain a JSON formatted string, which you will have to deserialize into C# objects. This lecture will teach you how a JSON is conformed, and how to easily create the C# classes that will help with deserializing a JSON.

Reading the Response as JSON

In this lecture you will learn to use the Newtonsoft.Json package to transform a JSON formatted string into C# objects, by creating the correctly formatted classes for the JSON that has been received from the CustomVision API.

Deserializing JSON

In this lecture you will define a ListView to display the response from the API service, already deserialized from JSON into C# objects, by using a GridView, so you can have multiple columns inside of the ListView. You will also learn how to use the Path and StringFormat properties when binding on XAML.

Displaying the Results using a GridView
+ MVVM - The Weather App
22 lectures 02:59:57

In this lecture you will start to understand why is an architectural pattern useful, and how the MVVM pattern is going to work and be devided. Also, you will understand the benefits of implementing a pattern, since it makes the code easier to maintain, easier to test, easier to reuse and overall more efficient.

Intro to the MVVM pattern

In this lecture we will explore the Accu Weather API services that are available for free for us to use, so we understand eventually what type of requests we have to make from our application

AccuWeather API

In this lecture we continue to explore the AccuWeather API to familiarize ourselves with how the requests are made, for us to later implement them on our Xamarin applications in the form of HTTP REST requests

The Endpoints that We Will Use

In this lecture you will take a look at the previous projecst ahta you have built to try and identify what would be conforming the Model part of the MVVM pattern in them, before jumping into creating a new WPF application.

The Model

In this lecture you will use the example JSON response by the AccuWeather API endpoint to create the C# classes that will be necessary to eventually deserialize that JSON into C# objects, with the help of the Json Utils online tool

Defining the Classes

In this lecture you will take a look at the other projects that you have built and identify what the View Model would look like if you had implemented the use of the MVVM architectural pattern inside it. You will also begin to understando how the MVVM pattern could help you reuse this sort of code between many different projects.

The View Model

Now that you understand how to layout the View Model inside your projects, in this lecture you will create the code that makes GET requests to both of the endoints of the API by building the list in the format that is required and getting a key from the service.

Requests to the AccuWeather API

In this lecture you will explore the way that the View should be layed out inside the projects that you build, and how the communication between it and the View Model will occur.

The View

In this lecture you will define what information from the Model you need to display inside the View, and create a New Window. You will learn how to change the default launch Window from the App class by modifying the StartupUri value, how binding will substitude naming the elements, and how commands will substitude event handlers.

Defining the UI

In this lecture you will learn about the INotifyPropertyChanged interface, which will let objects update each other through binding and repsond to value changes to always keep the information updated.

The INotifyPropertyChanged interface

In this lecture you will implement the INotifyPropertyChanged interface on a new ViewModel classes, as well as create the OnPropertyChanged method that will be called from the setter of every property to handle changes to the values.

Implementing the INotifyPropertyChanged interface

In this lecture you will learn to implement binding through XAML with the help of a new ViewModel class, and to set some binding in design time thanks to the Design Properties available in WPF applications

Binding Context and Design Time Binding

In this lecture we will check if our bindings are working correctly, and learn about design time only bindings, which will only be set while the application is being designed, and not when it runs.

Using Design Mode Bindings

It is time to learn about the ICommand interface and how it will help replace event handlers from the code behind over to elegant commands in the ViewModel. You will learn how the command works and uses its CanExecute and Execute members to implement a greatly related functionality with buttons and other elements.

The ICommand interface

In this lecture you will implement the ICommand interface inside of a new class defined inside the ViewModel, and call some of the ViewModel's functionality directly by adding a ViewModel property from the Execute method and ignoring the parameter received in the CanExecute to simply always return true

Implementing the ICommand interface

Now that the ICommand is implemented, the ViewModel will require a property of that type to be able to bind it to the view through the setting of Source and Path, pointing to that public proeprty. The command will also need a special initialization and the binding of the CommandParameter to create a robust connection with the View

Binding the ICommand

In this lecture we will bind a command parametter to the ICommand from the button, so that that parameter can be used to re-evaluate the CanExecute for the command, and make sure that the button is disabled when no query has been set yet.

Using a Command Parameter

, how it uses the INotifyCollectionChanged interface to maintain the view updated of any changes to the collection, either when adding new elements, deleting them or modigying them."}" data-sheets-userformat="{"2":769,"3":[null,0],"11":4,"12":0}">In this lecture you will learn about the ObservableCollection<T>, how it uses the INotifyCollectionChanged interface to maintain the view updated of any changes to the collection, either when adding new elements, deleting them or modigying them.

The ObservableCollection<T> class

In this lecture you will create a new property that is of type ObservableCollection<T>, so that we have a list of cities that will update the view with the cities that are retrieved from the autocomplete endpoint for the Accu Weather API.

Using the Observable Collection class - PART 1

Now that you react to changes in the text of a TextBox with the help of Binding, you will bind an ObservableCollection to a ListView, and also get the SelectedItem through TwoWay binding so we can get the weather, which will also be bound by changing the Source, Path, UpdateSourceTrigger and Mode binding setters

Using the Observable Collection class - PART 2

In this lecture you will learn about the IValueConverter interface as yet another interface that will help in the implementation of great functionality from the ViewModel to the View, as communication between the Model and the View. You will learn about its Convert and ConvertBack members, and some examples of how to use this.

The IValueConverter interface

In this lecture you will create a new class inside the ViewModel and have it implement the IValueConverter interface so you can use it to transform a bool over to a string, and eventually into information that the user will find helpful to be displayed inside the View.

Implementing the IValueConverter
  • Some previous programming experience in C# or a similar language like Java is recommended, but not essential
  • Access to a computer running Windows (previously Windows 10, but Windows 7 or 8 is ok as well).
  • If not running Windows natively, a Virtual machine running Windows is required.

Do you know a little programming in C# or another language, but are struggling to get an interview, let alone a job?

Maybe you are stuck in a low paying programming job, and want to move up to a better, more senior position.

Perhaps you want to learn a new skill and expand your rèsumè.

Or maybe you want to improve your .NET skills by learning a new and valuable framework.

If one or more of these things describe you, then I'd suggest you give serious consideration to this course.

This course will teach you how to create applications that have a rich user interface, using Microsoft's Windows Presentation Foundation (WPF).

What is WPF ?

WPF is part of the .NET framework and  provides a consistent programming model for building applications by separating the user interface from business logic.  It uses XAML (an XML based language) and C#.  The runtime libraries are included with all versions of Microsoft Windows since Windows Vista.  It's heavily supported by Microsoft and is a mature and powerful framework.

Why should you bother to learn it?

Many, perhaps most enterprise level .NET applications are built in WPF because of it's ability to create loosely coupled apps where the business logic and presentation layer are separated.  This also applies to apps in general that are developed in .NET.  A good portion of Winforms based projects are being upgraded to WPF as well.

WPF developers are in high demand and WPF is fully supported by Microsoft in the latest versions of Visual studio and .NET.  It's a key part of Microsoft's strategy moving forward.

What will you learn in this course?

WPF is developed using C# and XAML.  You will learn how to use WPF to build and access powerful REST services (specifically weather information and machine learning in this course).  You will also learn to create your own cloud services, and learn languages and patterns the open up future opportunities in Xamarin as well (iOS, Android and the Universal Windows Platform (UWP).

In addition, in this course you will learn C#, XAML, the MVVM (Model-View-ViewModel) architectural pattern, Azure App and Storage services, and SQLite and more.

Why enrolling in this course is the best decision you can make.

Other courses focus on isolated examples on what you can do with WPF.  Not this course!  This course guides you through the creation of real world applications as you learn more and more about WPF. You will:

  1. Build a calculator as you learn:
    1. C#
    2. XAML
    3. Styles
  2. Build a contacts app as you learn:
    1. SQLite
    2. Using ListViews
    3. Creating Custom Controls
  3. Build a machine learning classifier as you learn:
    1. REST services
    2. Picking images from the computer
  4. Build a weather app as you learn:
    1. The MVVM architectural pattern
    2. More REST
  5. Build a notes app as you learn:
    1. More WPF controls such as toolbar, speech to text, toggle buttons, comboboxes, context menus and rich text format editors
    2. To add Azure App Services for cloud hosted databases
    3. To add Azure Storage Account services for storing files in the cloud
    4. To add Animations

Your instructor, Eduardo Rosas, is a certified Xamarin Mobile Developer who has been building apps with C# and XAML since 2012.

This means you are learning from someone who has all the professional training, skills, and experience you need to teach you how to become proficient with WPF in the fastest possible way.  But all the while being taught the right way to program.

If you are ready to get that first paid programming job, or to move up to a more senior programming position, then this course is for you!

After completing this course, you will have the necessary skills to be able to use create your own WPF desktop apps giving you increase career opportunities.

The sooner you sign up for this course, the sooner you will have the skills and knowledge you need to increase your job or consulting opportunities.    Your new job or consulting opportunity awaits!  

Why not get started today?

 Click the Signup button to sign up for the course!

Who this course is for:
  • Anyone wanting to understand and use Windows Presentation Foundation (WPF)
  • Anyone wanting to increase career options by learning an important Microsoft Windows development technology