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
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
They are freely available on MSDN. The "directory" page can be found at:
http://msdn.microsoft.com/en-us/library/aa970773(v=vs.110).aspx
I realize this is a link-only answer, but the answer really is a link...
Currently, googling "WPF Control templates" shows the linked article as the second result. If the link changes, the same search may yield good results.
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();
}