开发者

Databinding in WPF - textboxes to a business object added via Data / Add New Data Source

开发者 https://www.devze.com 2023-03-27 12:53 出处:网络
Very simple in WinForms, but in WPF - using System.Windows.Controls.TextBoxes, I can\'t figure out how I could bind them to a business object, which I just added as data source (Data, Add New Data Sou

Very simple in WinForms, but in WPF - using System.Windows.Controls.TextBoxes, I can't figure out how I could bind them to a business object, which I just added as data source (Data, Add New Data Source, Object...); in the designer, that is.

Working with WinForms, all I have to do is to go to its Properties开发者_Python百科, then DataBindings and Advanced, where I can just bind its property with a property of the object.

What is the equivalent of doing that in WPF?


Very easy in XAML:

<TextBox Text="{Binding YourProperty}" />

In VS2010 designer you can also do it from the property grid

0

精彩评论

暂无评论...
验证码 换一张
取 消