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
.
精彩评论