Best approch for creating Base control
Posted
by akjoshi
on Stack Overflow
See other posts from Stack Overflow
or by akjoshi
Published on 2010-04-09T11:50:17Z
Indexed on
2010/04/09
11:53 UTC
Read the original article
Hit count: 516
wpf
|wpf-controls
Hi,
I am looking for a solution for this scenario -
I need to implement a feature to allow user to add various controls to canvas(WPF, custom and third party ) and then select any one of them and modify some properties in property grid(changes needs to be reflected in UI).
I don't want to expose all the properties of any control only some of them(relevant to end user); apart from this there are some properties which will be common for all controls e.g. Title, Value(Value will be bound to some property of a control, say Text of TextBox and Content of Label) etc.
I am thinking of putting all the common proeprties at one place.
Things I am confused aout -
How to create such base class, whether to use UserControl or Custom Control for this?
How will the binding work between Control, base class proeprties and PropertyGrid?
What type of object will I expose to property grid?
Any idea on what approch should be followed in this case, any kind of input will really be helpful.
© Stack Overflow or respective owner