I am trying to learn about Dependency Properties and attached Properties in wpf, and I was wandering If someone could explain to me how to add a DependencyProperty to a wpf Control. In my case I would like to add a Dependency Property to Datagrid, do you have to create a custom wpf control to do this or can i simply add a dependency property to the wpf datagrids, how would I do this? I have been looking around and I believe it is possible but I am not exactly sure hw to achieve this :/
I am trying to learn about Dependency Properties and attached Properties in wpf, and
Share
You can’t add code to a framework class. If you want a Datagrid but with a dependency property, you’ll have to inherit from Datagrid and declare the dependency property in your derived class.