WPF中,怎么在后台代码进行数据绑定

2024-12-12 17:48:21
推荐回答(1个)
回答1:

Binding binding = new Binding();
binding.Path = new System.Windows.PropertyPath(_zYXTabList[i].Name);
//binding.Mode = BindingMode.TwoWay;
//binding.UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged;
//gvc.SetBinding(TextBlock.TextProperty, binding);
gvc.Width = 80;
gvc.DataMemberBinding = binding;