tags:

views:

36

answers:

1

Hello,

Could any explain the following meaning of TextBlock.Text and Binding Path?

<TextBlock>
    <TextBlock.Text>
        <Binding Path="Something" /> 
    </TextBlock.Text>
</TextBlock>

Thanks.

+2  A: 

TextBlock..Text: Property Gets or sets the text contents of a TextBlock. This is a dependency property. Note that all non-text content is stripped out, resulting in a plain text representation of the TextBlock contents. The default is String.Empty.

Binding.Path Property: Gets or sets the path to the binding source property. The default is nullNothingnullptra null reference (Nothing in Visual Basic).

DependencyProperty: Represents a dependency property that is registered with the Windows Presentation Foundation (WPF) property system. Dependency properties provide support for value expressions, property invalidation and dependent-value coercion, default values, inheritance, data binding, animation, property change notification, and styling.

rahul
One more question: dependency property means?
Ricky
Updated the answer.
rahul
What about the relationship between <Binding Path...> and <TextBlock.Text>? Does it mean Text has another propery named Binding Path?
Ricky
It means that the Text property is bound to the value of "Something", which can be another property or resource.
OregonGhost