This article is currently in the process of being translated into Persian (~20% done).

Data binding:

Introduction to WPF data binding

Wikipedia describes the concept of data binding very well:

Data binding is general technique that binds two data/information sources together and maintains synchronization of data.

With WPF, Microsoft has put data binding in the front seat and once you start learning WPF, you will realize that it's an important aspect of pretty much everything you do. If you come from the world of WinForms, then the huge focus on data binding might scare you a bit, but once you get used to it, you will likely come to love it, as it makes a lot of things cleaner and easier to maintain.

Data binding in WPF is the preferred way to bring data from your code to the UI layer. Sure, you can set properties on a control manually or you can populate a ListBox by adding items to it from a loop, but the cleanest and purest WPF way is to add a binding between the source and the destination UI element.


در فصل بعدی ما به مثالی که در آن از دیتا بایندینگ استفاده شده خواهیم پرداخت و بعد از آن راجع به سایر امکانات این تکنیک صحبت خواهیم کرد. در این راهنما مفهوم دیتا بایندینگ قدری زود معرفی شده به این دلیل که دیتا بایندینگ بخش جدایی ناپذیر wpf است چنانکه در فصلهای بعدی خواهید دید تقریباً استفاده از آن همیشگی است.

However, the more theoretical part of data binding might be too heavy if you just want to get started building a simple WPF application. In that case I suggest that you have a look at the "Hello, bound world!" article to get a glimpse of how data binding works, and then save the rest of the data binding articles for later, when you're ready to get some more theory.

This article has been fully translated into the following languages: Is your preferred language not on the list? Click here to help us translate this article into your language!