Skip to content

UWP TemplateBinding is "OneTime" #2268

Open
@DRAirey1

Description

@DRAirey1

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.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions