wpf 数据模板后台绑定事件的问题

GridViewColumn column = new GridViewColumn();
GridViewColumnHeader h = new GridViewColumnHeader();
h.Content = "??????";
h.Tag = "*******";
column.Header = h;
DataTemplate dt = new DataTemplate();
FrameworkElementFactory fef = new FrameworkElementFactory(typeof(CheckBox));
Binding binding = new Binding();
binding.Path = new PropertyPath("MarketIndicator");
fef.SetBinding(CheckBox.ContentProperty, binding);
fef.SetValue(CheckBox.ForegroundProperty, Brushes.White);
dt.VisualTree = fef;
column.CellTemplate = dt;
//-----------------------网上找的这段代码,是可以fef.SetValue来给CheckBox属性赋值,
但是如果fef.SetValue(CheckBox.ClickEvent,?); ?位置放什么才对呢,显示是object可是放上我写的事件函数名还是委托都是错误呢???,求如何给上层元素添加事件??

查看全部
keyinhong
keyinhong
2016/04/05 02:51
  • checkbox
  • net
  • 点赞
  • 收藏
  • 回答
    私信

0个回复