How to Bind To Data within a Datatemplate of a ContentControl

前端 未结 1 648
失恋的感觉
失恋的感觉 2020-12-28 14:09

I have the following simplified Example:

    

        
1条回答
  •  不知归路
    2020-12-28 14:51

    You need to bind the Content property of the ContentControl

    
    

    This will set the DataContext of the ContentControl as Content of the control.

    Setting only the ContentTemplate property is not enough. The ContentControl does not implicitly use its DataContext as Content.

    0 讨论(0)
提交回复
热议问题