문제

I've got a Control (mySubControl) which inherits from a UserControl (myAbstractControl) which is abstract. When I try to set dependency Properties inside mySubControl I always get errors on runtime, saying:

"System.Windows.Data Error: 40 : BindingExpression path error: 'myPropertyRegistrationName' property not found on ...."

I think somehow the DataContext of mySubControl gets messed up.

I tried to use the relative bindings, but it also doesn't fix it.

Visibility="{Binding RelativeSource={RelativeSource AncestorType={x:Type myNS:myType}},
                     Path=myPropertyRegistrationName}"

Can anybody help me ?

Thx

도움이 되었습니까?

해결책

It's always syntax, isn't it ?

Visibility="{Binding myPropertyRegistrationName, RelativeSource={RelativeSource FindAncestor, AncestorType=myNS:myType}}"

Thx anyway.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top