mirror of
https://github.com/Stone-Red-Code/docs-desktop.git
synced 2026-09-04 23:43:39 +02:00
1.4 KiB
1.4 KiB
title, description, ms.date, helpviewer_keywords, ms.assetid
| title | description | ms.date | helpviewer_keywords | ms.assetid | |||
|---|---|---|---|---|---|---|---|
| How to: Create a Simple Binding | Create a simple binding for your applications through this how-to example in Windows Presentation Foundation (WPF). | 03/30/2017 |
|
69b80f72-6259-44cb-8294-5bdcebca1e08 |
How to: Create a Simple Binding
This example shows you how to create a simple xref:System.Windows.Data.Binding.
Example
In this example, you have a Person object with a string property named PersonName. The Person object is defined in the namespace called SDKSample.
The highlighted line that contains the <src> element in the following example instantiates the Person object with a PersonName property value of Joe. This is done in the Resources section and assigned an x:Key.
[!code-xamlSimpleBinding]
The highlighted line that contains the <TextBlock> element then binds the xref:System.Windows.Controls.TextBlock control to the PersonName property. As a result, the xref:System.Windows.Controls.TextBlock appears with the value "Joe".