开发者

How do I sublass a control along with its attached properties?

I am trying to subclass System.Windows.Contro开发者_开发百科ls.DataGrid in order to add special commands to which a view model can bind. How do I do this and still have the Columns attached property? Do I have to declare it against my new type in order to use it?


Columns is not an attached property.. you should use it the same way you always do, just replace DataGrid with your-control-name:

<my:MyDataGrid>
  <my:MyDataGrid.Columns>
     <!--  Columns goes here --->
  </my:MyDataGrid.Columns>
</my:MyDataGrid>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜