How to get existing control's controltemplate in WPF in XAML format(visual tree)? This is to help to create new controltemplate with the help of existing template.
Is there a code to get it in XAML format?(like view the visual tree in tree format)
Sugirthini
2009-10-13 10:15:03
yes, since this tool does it... you can look at the code, it's provided in the zip file
Thomas Levesque
2009-10-13 10:31:04
+1
A:
If you have Expression Blend you can:
- Drag the control onto the design surface
- Right click the control and choose Edit Template -> Edit Copy
When you do this, Blend will extract the base template from the control and explicitly declare it within document/application as a resource which you can then edit to your liking. You can do this for any control.
Drew Marsh
2009-10-13 12:58:11
+1
A:
Please look at MSDN's ControlTemplate Examples they have given all controls in there.
However you can also extend existing style without redefining evrything by using "BasedOn" attribute.
Akash Kava
2009-10-13 14:21:14
A:
The book "Pro WPF in C# 2008", by Matthew MacDonald, includes a Control Template browser in Chapter 15. I believe you can simply download the sample code from the Apress web site.
David Veeneman
2009-12-19 13:15:08