Compiled Data Binding Fundamentals in UWP Using XAML

Compiled data bindings with x:Bind are faster than classical data bindings created with the Binding markup extension. This course will teach you the basics of x:Bind, including converting with functions, binding events and more.
Course info
Rating
(46)
Level
Intermediate
Updated
Aug 19, 2016
Duration
2h 49m
Table of contents
Course Overview
Using Classical Data Binding
Introducing Compiled Data Binding
Understanding the Binding Modes
Converting and Casting
Rendering Your Data
Binding to Commands and Events
Binding to Elements
Knowing When to Use Classical Data Bindings
Description
Course info
Rating
(46)
Level
Intermediate
Updated
Aug 19, 2016
Duration
2h 49m
Description

At the core of developing a great performing Universal Windows Platform app with MVVM is a thorough knowledge of compiled data bindings. In Compiled Data Binding Fundamentals in UWP with XAML, you will learn the skills to build high-quality and fast responding apps. You will learn how to create compiled data bindings with the x:Bind markup extension, how to use the different binding modes, how to convert values with functions, how to cast values directly in XAML, how to use compiled data bindings in Data Templates, and finally how to replace the ICommand-properties of a ViewModel by binding events directly to methods of your ViewModel. When you're finished with this course, you will have a foundational knowledge of compiled data bindings with the x:Bind markup extension that will help you immensely as you move forward to create your own high-quality Universal Windows Platform app.

About the author
About the author

Thomas is a well-known author, software developer, and speaker from Germany. He specializes in .NET, C#, TypeScript, XAML, and Azure.

More from the author
.NET Standard: Getting Started
Intermediate
2h 44m
May 14, 2018
More courses by Thomas Claudius Huber
Section Introduction Transcripts
Section Introduction Transcripts

Course Overview
Hi everyone. My name is Thomas Claudius Huber and welcome to my course Compiled Data Binding Fundamentals in Universal Windows Platform Using XAML. I am a Microsoft MVP for Windows development and I have a passion for user interfaces. To create a data binding in XAML in a Universal Windows Platform app, you can either use the classical binding markup extension or the newer x:Bind markup extension. While the binding markup extension is resolving the binding path at runtime, x:Bind resolves the binding path at compile time. This makes x:Bind faster than the classical binding markup extension. This course is an introduction to compiled data bindings with the x:Bind markup extension. Some of the major topics that we will cover include using x:Bind to bind to a view model, debugging, and getting compile-time errors, converting and casting in the x:Bind markup extension, rendering data with data templates and x:Bind, and replacing the ICommand in a typical MVVM application by binding events to methods of your view model. By the end of this course you will know how to use the x:Bind markup extension to improve the performance, the code, and the developer experience of your Universal Windows Platform apps. Before beginning the course, you should be familiar with XAML, you should also install the Windows 10 anniversary update or a later Windows 10 build including the SDK. I hope you will join me on this journey to learn about the x:Bind markup extension with the course Compiled Data Binding Fundamentals in Universal Windows Platform with XAML at Pluralsight.

Introducing Compiled Data Binding
Welcome to the module Introducing Compiled Data Binding. My name is Thomas Claudius Huber and in this module I will show you the basics about the compiled data binding in Universal Windows Platform apps. Let's take a quick look at the module outline. in this module you'll learn about the x:Bind markup extension that is used in XAML to create a compiled data binding. You will also learn about the data source of x:Bind and we will bind to a ViewModel by using that markup extension. After we have done this, you will see how you can get compile-time errors with that compiled data binding. You will also see how you can debug into the generated data binding codes. Okay so let's start with the x:Bind markup extension.

Understanding the Binding Modes
Welcome to the module Understanding the Binding Modes. My name is Thomas Claudius Huber and in this module you will learn how to use the different binding modes in a compiled data binding. So let's have a quick look at the module outline. We start this module with an overview of the different binding modes, OneTime, OneWay, and TwoWay. These binding modes are similar to the binding modes of a classical data binding. But the compiled data binding has a different default mode. After you are familiar with the binding modes, you will extend the user interface in the FriendEditor application to a master/detail user interface. Currently the user interface of the FriendEditor has just the ListView. Then we will reach a point in this module where we need to update the OneTime binding in the user interface. To be able to do this, you will learn about the binding-initialization and then you will know how you can update OneTime bindings in the UI. Okay, let's start with the binding modes.

Converting and Casting
Welcome to the module Converting and Casting. My name is Thomas Claudius Huber and in this module you will learn how you can convert and cast values in a compiled data binding. Let me give you a quick overview of the module. We start this module by converting values between the target and the source of a compiled data binding. To convert the values you can use an IValueConverter like in a classical data binding. You just need to assign the IValueConverter to the Converter property of the x:Bind markup extension. But with x:Bind there is also another way how you can convert values between the target and the source. Instead of using an IValueConverter, you can bind the Target property to a function, then you do the conversion in that function. After you have learned how to convert values, you will also learn in this module how you can cast values directly in XAML in the x:Bind markup extension. Okay, let's start with converting values with an IValueConverter.

Rendering Your Data
Welcome to the module Rendering Your Data. My name is Thomas Claudius Huber and in this module you will learn how you can use the ToString method and DataTemplates with x:Bind to render your data in the user interface. Let's have a look at the module outline. The first thing we do, we will call the ToString method in x:Bind to format a string how we want it in the user interface. Then you will learn how you can use x:Bind in a DataTemplate and you will learn how you can render the items in a DataTemplate incrementally with the x:Phase attribute. After you are familiar with x:Bind in a DataTemplate, you will learn how you can move the DataTemplate with x:Bind to a resource dictionary. Okay, let's start with a ToString method in x:Bind.

Binding to Commands and Events
Welcome to the module Binding to Commands and Events. My name is Thomas Claudius Huber and in this module I show you how you can execute actions in your ViewModel with commands or even bindings. So let's have a look at the module outline. We start this module by looking at the ICommand interface and the MVVM pattern. After you are familiar with the ICommand interface, we will create and use a FriendDeleteCommand in the FriendEditor application. After you learned how to use a command to execute some actions in your ViewModel, you learn how you can bind events with the x:Bind markup extension. Then you learn how you can replace the FriendDeleteCommand with an Event Binding that is available with the x:Bind markup extension. So let's start with the ICommand interface and the MVVM pattern.

Binding to Elements
Welcome to the module Binding to Elements. My name is Thomas Claudius Huber and in this module I will show you how you can use x:Bind to bind to other elements in your user interface. Let's have a look at the module outline. You will learn in this module how you can use x:Bind to bind to other elements in your UI. Even when you use MVVM you want to use a binding to another element when it's really UI specific. You will see a sample of such a UI specific task in this module. You will also learn in this module how you can bind to relative sources like you are used to from the classical data binding. Now let's start with binding to other elements.

Knowing When to Use Classical Data Bindings
Welcome to the module Knowing When to use Classical Data Bindings. My name is Thomas Claudius Huber and in this module I will show you when it makes sense to use a classical data binding instead of a compiled data binding. Let's have a look at the module outline. We start this module by looking at the typical scenarios when you should use a classical data binding. One of these scenarios is Duck Typing. You will learn what Duck Typing is and you will also learn how you can migrate the typical Duck Typing code-base to x:Bind. Finally, I will show you that you can use x:Bind and Binding in the same page, and then we will wrap up what you have learned in this course. So let's start with the scenarios for classical data binding.