Introduction to Windows Programming with WPF
In this module students are introduced to Windows Presentation Foundation (WPF),
and how this framework can be used to build state of the art
applications. Building state of the art applications requires the input of designers
for building great visualizations. Now developers and designers can work together
on the same application.
- Introduction to the WPF Application
- WPF Architecture
- Designer/Developer Productivity: Declarative XAML
- The Visual Studio Designer
- LAB: Creating your first WPF Appplication
XAML is the UI-language important for developers using the Microsoft developer stack.
This module teaches students how to use the XAML language for building all kinds
of applications, focusing on WPF.
- What is XAML?
- XAML versus Code
- Looking at XAML Basic Syntax
- Understanding XAML Attached Properties
- Nesting Controls
- The Content property
- LAB: Working with XAML
XAML can be extended for your own custom purposes. In this case you need to understand following topics.
- Extending XAML through Markup Extensions
- Understanding CLR and XML Namespace Mapping
- Naming Elements
Developers and Designers Collaboration
In a perfect world, any developer is a great designer. Unfortunately this is not the case.
XAML allows for a clean separation between designing and developing.
- Developers versus Designers
- Visual Studio as a Development Tool
- Blend as a Designing Tool
- Overview of Blend
This module gives you an overview of what kinds of controls are available and how
to compose them together.
- Examining the Class Hierarchy
- Tweaking the UI with Transforms
- The power of Composability
- Content Controls, Container Controls, Header Controls, Item Controls
- Range Controls, using Text Controls
- Understanding Dependency Properties
- Routed Events
Introduction to WPF Layout
Display hardware becomes more and more diverse: big screens, small screens, high and low resolutions, adaptable font
This does require some special up-front design. In this module students will learn how to build applications
that run with all kinds of resolutions and fonts.
- Look at WPF Layout Capabilities
- Absolute Layout using Canvas
- Using StackPanel, WrapPanel and DockPanel
- The do-it-all Panel: Grid
- Tweaking using Panel Attached Properties
- LAB: Building a Layout with XAML and Visual Studio
Reusability with WPF Resources
Developers have always used specially built controls to re-use some of their work.
WPF has re-use built in, so in this module students will learn how to re-use objects
for their applications.
- Re-using Objects through Resources
- Resource Inheritance
- Static Resources
- Dynamic Resources
- Resources and code-behind Merging Resource Dictionaries
- LAB: Creating some Resources with Visual Studio
End users should easily see when an element on your UI is interactive, or when a
new element has been added to your window. These things can easily be accomplished by
WPF Animations, which greatly improves the user experience. In this module students will
learn how provide feedback to the user using animations.
- What are Animations?
- Working with Storyboards
- Animations in Code
- Creating Animations in Blend
Principles of WPF Styles, Triggers and Templates
Professionally built web sites use cascading style sheets (.css) to quickly change
the look and feel of the site. WPF takes this to the next level with styles and
templates. In this module students will learn how to quickly customize their whole
application with styles and templates.
- Why we need Styles
- Example: Restyling a ListBox
- Intro to Templates
- LAB: Create a Button Template with Blend
Entity Framework Core
With .NET also comes a whole new Entity Framework Core.
A modern, faster implementation of EF, which can run cross-platform, on Windows, Mac and Linux.
- Differences with .NET 4.x Entity Framework
- Scaffolding your Project from an Existing Database
- Understanding the Generated Code
- Interacting with the Database with LINQ
- LAB: Scaffolding your Model from an Existing Database
Using WPF Data Binding
Once the data is retrieved, we need to display it to the user and allow changes
to be validation and captured efficiently. In this module students will learn how
to use data binding to accomplish this.
- The Need for Data Binding
- Binding in Code and Markup
- Introduction to Simple Data Binding
- Converting Data for Data Binding
- Introduction to Complex Data Binding
- Understanding Source and DataContext
- LAB: Databinding to Data with a Parent-Child Relationship
User input needs to be validated. Are all required properties provided? Do the values match the format?
WPF offers several options for validation that are explored in the following chapter.
- Validation Rules
- Custom Feedback
The Visual State Manager and Custom Controls
When customizing an interactive element for your UI, you need to specify the look and feel
in all circumstances. The Visual State Manager is a mediator that allows changing styles and templates
based on certain conditions. In this module students will
learn how set up and use the Visual State Manager.
- What is the Visual State Manager?
- Parts, States, Transitions and State Groups
- Responding to State Changes
- Custom Controls with the Visual State Manager
- Using the Visual State Manager for Responsive Layout
- Using the Visual State Manager in Blend
- LAB: Customizing a Control with Visual State Manager
Introduction to the MVVM Pattern
MVVM is a version of the MVC pattern designed specifically for WPF, which heavily relies on Data Binding
- What is the MVVM Pattern?
- Using Commands instead of Event Handling
- Defining the Model
- Adding the ViewModel
- Binding the View to the ViewModel
- LAB: Adding a View and ViewModel to a WPF Application
"If this then that", that's what behaviors are all about. It allows you to set up new functionality for an existing
control in a declarative way.
- Built-in Behaviors
- Custom Behavior
Dependency Injection in WPF
When writing code, you have to make sure you are not introducing unnecessary dependencies on other objects.
Dependencies will just cost you on the long run since they are harder to maintain, not easily testable,
exchangeable, ... . If you need to depend on another, then depend on the interface. Interfaces describe the
dependency, but do not force it. Now, you don't want those dependencies to be filled hard coded and this is where
dependency injection (DI) can help you. Dependency injection can help you at runtime dynamically deciding which
implementations to plug into the dependencies.
- What is Tight Coupling and how to prevent it?
- Using Inversion of Control (IoC) containers.
- Constructor and Property injection.
- Microsoft.Extensions.DependencyInjection as an example.
Introducing ASP.NET Web API
This part will show students how to create and consume web services with Web API.
- REST Services
- CRUD Operations
- Feature Overview
Consuming a ASP.NET Web API REST Service with HttpClient
- HttpClient and WebHttpRequest Class
- JSON Serialization and Deserialization
- LAB: Consuming a REST service from WPF
Deploying your WPF Windows Applications
This module will show students how to deploy their WPF application
- Using XCOPY deployment
- Using Click-Once
- Using an Installer