Skip to content

Instantly share code, notes, and snippets.

@namhnz
Created August 13, 2018 07:36
Show Gist options
  • Save namhnz/a7ab6eb6be242d1ae560c65cc1adeff0 to your computer and use it in GitHub Desktop.
Save namhnz/a7ab6eb6be242d1ae560c65cc1adeff0 to your computer and use it in GitHub Desktop.
Hướng dẫn cách bind Image trong WPF
Với Image thì chúng ta có thể sử dụng đoạn code như sau để bind Image trong XAML với một url trong code-behind:
<Image Source="{Binding Url}" />
Để có thể load hình ảnh bất đồng bộ chúng ta thêm thuộc tính IsAsync="True":
<Image Source="{Binding Url, IsAsync=True}" />
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment