Open
Description
I have a templated control. When I try to bind to a custom property using TemplateBinding, it appears to bind the the initial value, then doesn't change when I update that value.
<local:AnimatedUpDownBrush IsUp="{TemplateBinding IsUp}">
However, when I explicitly try to set the binding to OneWay, it works:
<local:AnimatedUpDownBrush IsUp="{Binding Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}, Path=IsUp}">
What little documentation I can find on the subject says that TemplateBinding is the equivalent of the second example here, but that's clearly not the case. Is something broken with the documentation or the way I'm trying to template bind? Do you have to do something special when registering the DependencyProperty?
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
- ID: 51f84e98-7384-1ccf-1e3c-f0ccd090aabc
- Version Independent ID: 57c8db16-c30e-8607-d009-fd65bf82b0c7
- Content: TemplateBinding markup extension - UWP applications
- Content Source: windows-apps-src/xaml-platform/templatebinding-markup-extension.md
- Product: uwp
- Technology: platform
- GitHub Login: @jwmsft
- Microsoft Alias: jimwalk