开发者

WPF partial binding to specific control

I have a wpf form. Which contains labels and other controls. Whole form has concrete dataSou开发者_如何学Pythonrce. I want labels in this form have another biding. only labels

<Grid>

  <Label x:Name="label"/>
  <TextBOx />
  <Label x:Name="labe2"/>
  <TextBOx />

</Grid>


Your question is not clear enough. Do you mean to say that you bind your form's DataContext to some business object but still want to bind some of form elements (e.g. TextBox) to a different source? If so, you can always use Binding's Source, RelativeSource or ElementName to make the binding source other than DataContext.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜