开发者

How to get two different textboxes bound to two different data context?

开发者 https://www.devze.com 2023-01-11 13:14 出处:网络
Normally we bind a textbox\'s Text property to a data-context\'s properties. The data-context can be 1) the code behind (default) and 2) the view-model, 3) others which specified in Initial method of

Normally we bind a textbox's Text property to a data-context's properties. The data-context can be 1) the code behind (default) and 2) the view-model, 3) others which specified in Initial method of the form (this.Da开发者_StackOverflowtaContext = ... ).

What I want to do: bind two textboxes to two different data context in the same form. How can I do this?


You can set the DataContext property of the textbox to its own data context.

0

精彩评论

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