Asynchronous binding
Binding.IsAsync
allows loading the binding source asynchronously, without blocking the application UI. When using Binding.IsAsync
, WPF will use a ThreadPool
thread to resolve the binding asynchronously. When the data is available from the binding source, it is copied to the Target
property.
Let us create a small WPF application with just a
TextBlock
that displays the message of the day.The previous view can be defined in XAML, as follows:
<Window x:Class="MVVMAppPerformanceimprovement.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namespace:MVVMAppPerformanceimprovement" Title="MVVM Survival Guide" Height="250" Width="400"> <Window.DataContext> <local:MainWindowViewModel /> </Window.DataContext> <Grid> <TextBlock Width="300" Height="56" Foreground="White" ...