navigation framework in silverlight 3 skipping constructor when usercontrol is of a derived type

Posted by tarren on Stack Overflow See other posts from Stack Overflow or by tarren
Published on 2010-04-05T21:18:02Z Indexed on 2010/04/05 21:23 UTC
Read the original article Hit count: 267

Filed under:
|
|

Hi:

I am using the NavigationFramework in Silverlight 3, and am running into issues where the constructor of the UserControl in the xaml I am loading is not being called, and I believe this is because the UserControl in the xaml I am calling is actually derived from another user control.

I have stepped through the debugger with specific break points and the constructor is being ignored completey.

I have MyWindowBlue which is of type uctrlBaseMyWindow.

The constructor for uctrlBaseMyWindow is being called when the xaml is 'navigated to' but the constructor for MyWindowBlue is being ignored.

This is not the case if I add the user control via markup directly.

Anyone else have this issue?

The code I am using to navigate to the MyWindowBlue is

            this.MyContentFrame.Navigate(new Uri("/Controls/uctrlMyWindowBlue.xaml", UriKind.Relative));

Has anyone run into this or could offer any help?

Thanks

© Stack Overflow or respective owner

Related posts about Silverlight

Related posts about navigation