Powered by MSDN

US - English
NEW! Silverlight 5 is available Learn More

SL Test framework: OnApplyTemplate only called after th... RSS

1 reply

Last post Jun 06, 2009 06:53 PM by jay nanavati

(0)
  • osherove

    osherove

    0 Points

    6 Posts

    SL Test framework: OnApplyTemplate only called after the test page was loaded

    Jun 06, 2009 10:56 AM | LINK

    My custom control is running int o a very annoying issue:

    in my test I'm trying to check some dependency property, that also changes text in an inner child control.

    But the OnApplyTemplate is not called until the test page has finished, loading, which only happens after the test is complete. so that means my child controls are null.

     is there a workaround? am i missing something?

    testing

  • jay nanavati

    jay nanavati

    Contributor

    3517 Points

    668 Posts

    Re: SL Test framework: OnApplyTemplate only called after the test page was loaded

    Jun 06, 2009 06:53 PM | LINK

     In your custom control constructor, call to OnApplyTemplate method.

    and then in

    public override void OnApplyTemplate()
    {
    //Here call to base version of OnApplyTemplate.

     //then use GetTemplateChild method