WPF: How do I debug binding errors?

前端 未结 2 1643
别跟我提以往
别跟我提以往 2021-02-05 19:20

I\'m getting this in my output Window:

System.Windows.Data Error: 4 : Cannot find source for binding with reference \'RelativeSource FindAncestor, Ancesto

2条回答
  •  花落未央
    2021-02-05 19:51

    I ran into a similar problem with the TreeView (though my data binding errors showed up as being Informational).

    I solved the problem by defining an implicit style in the TreeView resource for TreeViewItem. Within that style I defined the missing vertical and horizontal content alignment properties.

    
         
    
    

提交回复
热议问题