list of controls with templates in silverlight
Does anyone know where to find a list of controls that you can set the template on in Silverlight? I've wasted several hours now trying to create control templates only to find that the control doesn't support the template property.
By "doesn't support" I mean:
<Style x:Key="blah" TargetType="Border">
<Setter Property="Template">
Throws an error saying "Invalid att开发者_如何学编程ribute value Template for property Property".
I now know that I can't create a template for TextBlocks or Borders. Is there a definitive list somewhere? It's not on Microsoft's site as far as I can tell.
Thanks!
Anything that extends Control
http://msdn.microsoft.com/en-us/library/system.windows.controls.control(VS.96).aspx
Classes that inherit from Control have templates, classes that inherit from FrameworkElement do not.
If you look at the docs for Border you will see it inherits from FrameworkElement.
This link Control Styles and Templates is also really useful because it lets you dive into what the default templates look like. This is a vital resource if you really want to completely override the visuals of a control.
精彩评论