【发布时间】:2010-03-01 11:07:36
【问题描述】:
在构建自定义用户控件时,可以从哪些控件继承具有 Children 属性并支持模板化。
目前我知道Panel,但它不支持DefaultStyleKey和GetTemplateChild()等属性和方法;
是否有一个我可以继承模板的接口,例如:
public class Scroller : Panel, ITemplates //Something like ITemplates
{
public override void OnApplyTemplate()
{
base.OnApplyTemplate();
container = GetTemplateChild("container") as StackPanel; //I want to be able to do this
this.Children; //And also be able to use this
}
}
【问题讨论】:
标签: silverlight xaml