Click here to Skip to main content
15,886,919 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
I want to create a custom control by which the control can draw controls in it by a dependency property value.
To make it clear, we have a custom control like in the following:
XML
<mycustomcontrol mypropery="TextBox"></mycustomcontrol>

My expectation is to draw a control(here is textbox) inside MyCustomControl according to the value of "myproperty".
Is something like this is posibble guys?
Thanks!
Posted
Updated 18-Sep-15 21:01pm
v2
Comments
Sergey Alexandrovich Kryukov 19-Sep-15 3:29am    
Of course it is possible. What have you tried so far?
Only "to draw" sounds incorrect. You either insert UI elements into a logical tree, or do direct graohics rendering, but it has nothing to do with "its controls".
—SA
Sinisa Hajnal 21-Sep-15 2:30am    
It is possible, but you shouldn't do it. In your particular case you should add textbox to your custom control controls collection, not draw it from nothing.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900