WPF Binding Programmatically

前端 未结 2 1767
遇见更好的自我
遇见更好的自我 2020-12-11 14:58

I am attempting to convert this xaml binding to it\'s C# counterpart for various reasons:



        
2条回答
  •  借酒劲吻你
    2020-12-11 15:33

    I believe that you need to make the ActualWidthProperty throw a NotifyPropertyChanged event. Otherwise, the binding will not know to update when the property changes. Whenever I've done bindings, I've always had to implement INotifyPropertyChanged.

    You might try extending the list view class and then implementing it on the width property. I gave a similar answer here: WPF Toolkit DataGrid column resize event

提交回复
热议问题