microsoft partner logo color
8115  Reviews star_rate star_rate star_rate star_rate star_half

Introduction to Windows Presentation Foundation (WPF) using C#

This WPF .NET 8 training course teaches attendees how to build desktop applications with Microsoft’s WPF and .NET 8 frameworks, emphasizing the MVVM pattern, scalability, and maintainability....

Read More
Course Code NET-328
Duration 3 days
Available Formats Classroom

This WPF .NET 8 training course teaches attendees how to build desktop applications with Microsoft’s WPF and .NET 8 frameworks, emphasizing the MVVM pattern, scalability, and maintainability. Attendees learn how to build robust desktop applications, implement MVVM architecture, and use WPF controls and custom controls. In addition, the course covers unit testing for individual components.

Skills Gained

  • Understand the goals and benefits of WPF
  • Work with dotnet 8.0 command line interface and Visual Studio 2022
  • Make the right decisions about application architecture and data access technology
  • Use the MVVM design pattern to develop a robust and testable application
  • Build a compelling and maintainable desktop interface using XAML and code-behind
  • Gain experience building flexible application graphics with layout controls
  • Create customized controls with control templates and data templates
  • Add unit tests for robustness and maintainability improvements
  • Work through hands-on labs to develop modern Windows desktop application

Prerequisites

All students must have previous experience developing applications with C#, including knowledge of .NET Framework fundamentals.

Course Details

Training Materials

All WPF training students receive comprehensive courseware.

Software Requirements

  • Windows 10 or later with at least 8 GB RAM
  • Visual Studio 2022
  • .NET 8.0 SDK
  • LocalDB or another version of SQL Server

Outline

  • Introduction
    • History of WPF
    • Purpose and Philosophy
    • Elements
    • Attributes
    • XAML vs Code
    • Create applications with dotnet CLI
    • Visual Studio projects
  • WPF Design Pattern - MVVM
    • Design Patterns Review
    • MVVM Design Pattern
    • Integrating with backend services
    • Model
    • View
    • ViewModel
  • WPF Controls
    • Control Structure (XAML/Code)
    • Common Controls and their use
      • Border
      • Button
      • CheckBox
      • ComboBox
      • RadioButton
      • ListBox
      • TextBlock
      • Label
      • TextBox
    • Content Control vs ItemsControl
  • WPF Layout Controls 
    • Panels and their features
      • Grid
      • StackPanel
      • WrapPanel
      • DockPanel
      • UniformGrid
      • Canvas
  • WPF Commands
    • ICommand Interface
    • Command Controls
    • Adding Commands
    • Extending Commands to other Controls
  • Routed Events
    • Review C# Events and Delegates
    • Introducing RoutedEvents
      • Bubbling Events
      • Tunneling Events
    • Application Specific Events
    • Raising Events
    • Propagating Events up the Visual Tree
  • WPF Resources
    • Review XAML
    • WPF Resources vs Embedded Resources
    • Resource Definition
    • Static Resource Binding
    • Dynamic Resource Binding
    • Resource Dictionary
  • WPF Styles
    • Understanding Styles
    • Visual Inheritance
    • Targeted Styles
    • Default Styles
    • BasedOn - Style Inheritance
    • Setters
    • Triggers
      • Trigger
      • MultiTrigger
      • DataTrigger
      • MultiDataTrigger
      • EventTrigger
  • Control Templates
    • Visual Tree vs Logical Tree
    • Viewing Control Template
    • Custom Control Template
    • Visual States
    • Control Template as Custom Element
  • Data Template
    • ItemsControls and Data Templates
    • Defining Data Template – XAML
    • Data Binding in Data Template
    • Style in Data Template
    • Using Data Template as View in MVVM
  • Data Binding
    • Binding Source/Target
    • Binding Type
      • Two-Way
      • One-Way
      • One-Time
      • One-Way-To-Source
  • Data Context
    • Element Binding
    • Relative Source Binding
    • Data Converters
  • Custom Controls
    • Window/Page/UserControl
    • Dependency Properties
  • Validation
    • INotifyDataErrorInfo
    • IDataErrorInfo
    • ValidationRule
    • ErrorTemplate
    • Validation Timing
  • Debugging WPF Applications
    • Visual Studio Debugger
    • Live Visual Tree
    • Binding Failures
  • Unit Testing WPF Applications
    • Organizing Tests
    • Testing Code
    • Testing XAML
  • Conclusion