The default Control Templates exist, obviously, in binary form in the different DLLs that we add as "References" to each of our projects.
Do they exist in ASCII/source form somewhere? Are they available?
TIA
There are free tools available to explore the templates of the default wpf controls, e.g. Show Me The Template! (there are also tools for control styles, see StyleSnooper).
Alternatively you can explore templates with the following:
private string getTemplate(Control control)
{
StringBuilder stringBuilder = new StringBuilder();
XmlWriterSettings xmlSettings = new XmlWriterSettings();
xmlSettings.Indent = true;
using (XmlWriter xmlWriter = XmlWriter.Create(stringBuilder, xmlSettings))
{
XamlWriter.Save(control.Template, xmlWriter);
}
return stringBuilder.ToString();
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With