Description
The following paragraph mistakenly mixes up data binding source and target
One way of doing that is to derive the class that represents your binding source from DependencyObject, and expose a data value through a DependencyProperty. That's how a FrameworkElement becomes observable. FrameworkElements are good binding sources right out of the box.
Rationale
According to Every binding involves these pieces (five paragraphs ahead):
- A binding target: This is a DependencyProperty of the FrameworkElement in your UI that displays the data.
If it's correct, however, then ...
... I propose to elaborate ony why and when a control becomes a binding source. At this stage, the context on this page implies that binding sources may be plain view model objects only. I also propose to add a micro example, demonstrating on how to utilize DependencyObject/DependencyProperty on the HostViewModel
sample view model class.
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
- ID: 53f752d7-062a-4935-02c6-48371c208792
- Version Independent ID: daa135bb-7f77-3e62-05da-b18a9bfcdf12
- Content: Data binding in depth - UWP applications - Binding source
- Content Source: windows-apps-src/data-binding/data-binding-in-depth.md
- Product: uwp
- Technology: data-and-files
- GitHub Login: @lastnameholiu
- Microsoft Alias: alholiu