在silverlight里自定义一个控件,在自定义控件类里面定义依赖属性出错。

在silverlight里自定义一个控件ReplicationEventComboBox继承ComboBox,在ReplicationEventComboBox类里面定义依赖属性TextProperty。
图片说明
其中ReplicationEventComboBox中 private TextBlock _text; 字段在方法OnApplyTemplate()中被赋值 var text = this.GetTemplateChild("X_Text") as TextBlock;
if (text != null)
{
_text = text;
SetDisplayContent(false);
}。
现在在图中SetText方法中 control._text 为空 。 导致赋值时出错

求大神帮忙解答一下。