开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜