Binding ElementName inside a DataTemplate

前端 未结 1 1457
野的像风
野的像风 2020-12-31 01:39

I am trying to bind a property that is dependent on a control within the same DataTemplate.

To illustrate:


    <         


        
相关标签:
1条回答
  • 2020-12-31 02:07

    This is probably a namescope issue, the binding is not a framework element, any objects inside it will not share the outside namescope, nor is the binding in any tree, so relative source bindings should fail as well.

    You can try using x:Reference instead, it uses a different mechanism:

    {Binding SelectedItem, Source={x:Reference ComboList}}
    
    0 讨论(0)
提交回复
热议问题