none
ContentControls Content set before Parent set

    Question

  • I try to programmatically set Content of Content control before it is placed on its parent, I get an Exception with that stacktrace:

       w MS.Internal.XcpImports.CheckHResult(UInt32 hr)
    w MS.Internal.XcpImports.SetValue(IManagedPeerBase obj, DependencyProperty property, DependencyObject doh)
    w MS.Internal.XcpImports.SetValue(IManagedPeerBase doh, DependencyProperty property, Object obj)
    w System.Windows.DependencyObject.SetObjectValueToCore(DependencyProperty dp, Object value)
    w System.Windows.DependencyObject.SetEffectiveValue(DependencyProperty property, EffectiveValueEntry& newEntry, Object newValue)
    w System.Windows.DependencyObject.UpdateEffectiveValue(DependencyProperty property, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, ValueOperation operation)
    w System.Windows.DependencyObject.SetValueInternal(DependencyProperty dp, Object value, Boolean allowReadOnlySet, Boolean isBindingInStyleSetter)
    w System.Windows.DependencyObject.SetValueInternal(DependencyProperty dp, Object value)
    w System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value)
    w System.Windows.Controls.ContentControl.set_Content(Object value)
    .... My code stack trace here
    My code works well on Silverligth 5 beta.
    Tuesday, November 15, 2011 3:52 AM

Answers

All replies