Custom Control Dependency Property Binding

后端 未结 1 1494
清酒与你
清酒与你 2021-01-03 20:55

I am going insane trying to get this to work with even the most basic example. I cannot for the life of me get binding to work. Here is a super easy example that is not work

相关标签:
1条回答
  • 2021-01-03 21:06

    You haven't set the proper binding source. You would either have to set RelativeSource:

    <Label Content="{Binding TestProp, RelativeSource={RelativeSource Mode=TemplatedParent}}" />
    

    Or use TemplateBinding:

    <Label Content="{TemplateBinding TestProp}"/>
    
    0 讨论(0)
提交回复
热议问题