tags:

views:

273

answers:

2

Hello! Can You tell me about subj? For example I need to create new custom control that must be derived from datagrid and toolbar. And I want that new control to expose/propagate properties of base controls in order they to be accessed easily. The only way I know is deriving a class. Then descendant automatically gets all properties of ancestor. But multiple deriving in C# is prohibited, so I don't know how to expose properties and other behavior of second control... Styling and templating of such custom control is also needed.

Thanks!

A: 

In WPF inheritance is "out". ;O) Actually, it was complicated before WPF already, but with WPF you get various really powerful alternatives.

For the basic control I thing you'd better go with composition, create some usercontrol and make it contain a ToolBar and a DataGrid. You can then expose these as public properties, if you need to manipulate them from outside.

For special feature additions, attached properties are a very versatile mechanism.

Simpzon
A: 

Watching a window from windowsclient.net is a good place to start.

Make sure you understand dependency properties well.

Reading wpf blogs is my best guest for what to do then.

modosansreves