This is a migrated thread and some comments may be shown as answers.

The provided DependencyObject is not a context for this Freezable

3 Answers 32 Views
RibbonView and RibbonWindow
This is a migrated thread and some comments may be shown as answers.
BENN
Top achievements
Rank 1
BENN asked on 26 May 2019, 02:10 PM

Few of our customers sometimes experience the exception above (I assume it doesn't always happen to them), and we get the crash report through our diagnostics system.

The stack trace is:

  at System.Windows.Freezable.RemoveContextInformation(DependencyObject context, DependencyProperty property)\r\n   at System.Windows.Freezable.RemoveInheritanceContext(DependencyObject context, DependencyProperty property)\r\n   at System.Windows.DependencyObject.RemoveSelfAsInheritanceContext(DependencyObject doValue, DependencyProperty dp)\r\n   at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)\r\n   at System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType, Boolean isInternal)\r\n   at System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value)\r\n   at Telerik.Windows.Controls.RadRibbonWindow.SetThemeTemplate(RadRibbonWindow ribWin)\r\n   at Telerik.Windows.Controls.RadRibbonWindow.OnApplyTemplate()\r\n   at System.Windows.FrameworkElement.ApplyTemplate()\r\n   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)\r\n   at System.Windows.UIElement.Measure(Size availableSize)\r\n   at System.Windows.Interop.HwndSource.Process_WM_SIZE(UIElement rootUIElement, IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam)\r\n   at System.Windows.Interop.HwndSource.LayoutFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)\r\n   at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)\r\n   at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)\r\n   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)\r\n   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)

 

The problem looks like coming from:

RadRibbonWindow.SetThemeTemplate

Are you aware of issues that can cause it?

 

Thanks.

3 Answers, 1 is accepted

Sort by
0
Martin Ivanov
Telerik team
answered on 29 May 2019, 07:33 AM
Hello Benn,

We are not aware what is causing the reported issue. However, I've done a little research on the error and it seems that it usually relates with brushes or images. May I ask you to share some runnable code showing the RadRibbonView setup in XAML and code-behind, so I can check it on my side?

Regards,
Martin Ivanov
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
BENN
Top achievements
Rank 1
answered on 29 May 2019, 11:47 AM

It won't be hard to share all the source code (It is huge, and making a runnable minimized code that will also reproduce the problem is not an easy task, and since this problem is kind of rare and never happened to me in debug then I cannot even guarantee that the given code would ever reproduce it).

I'm also investigating it, and I'll keep you posted if I find anything interesting.

0
Martin Ivanov
Telerik team
answered on 29 May 2019, 12:52 PM
Hello Benn,

Looking forward to hear more about this, if you find anything.

Regards,
Martin Ivanov
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Dev
Top achievements
Rank 2
commented on 04 Oct 2021, 03:13 PM

Hi,

We are also noticing the same error. Any update or solution for this issue?

Errors: System.ArgumentException -- The provided DependencyObject is not a context for this Freezable.  Parameter name: context    at System.Windows.Freezable.RemoveContextInformation(DependencyObject context, DependencyProperty property)     at System.Windows.Freezable.RemoveInheritanceContext(DependencyObject context, DependencyProperty property)     at System.Windows.DependencyObject.RemoveSelfAsInheritanceContext(DependencyObject doValue, DependencyProperty dp)     at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)     at System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType, Boolean isInternal)     at System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value)     at Telerik.Windows.Controls.RadRibbonWindow.SetThemeTemplate(RadRibbonWindow ribWin)     at Telerik.Windows.Controls.RadRibbonWindow.SystemParametersCallback(DependencyObject sender, Object o)     at System.Windows.DependencyObject.ProcessCoerceValue(DependencyProperty dp, PropertyMetadata metadata, EntryIndex& entryIndex, Int32& targetIndex, EffectiveValueEntry& newEntry, EffectiveValueEntry& oldEntry, Object& oldValue, Object baseValue, Object controlValue, CoerceValueCallback coerceValueCallback, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, Boolean skipBaseValueChecks)     at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)     at System.Windows.DependencyObject.InvalidateProperty(DependencyProperty dp, Boolean preserveCurrentValue)     at System.Windows.ResourceReferenceExpression.InvalidateExpressionValue(Object sender, EventArgs e)     at System.Windows.TreeWalkHelper.InvalidateResourceReferences(DependencyObject d, ResourcesChangeInfo info)     at System.Windows.TreeWalkHelper.OnResourcesChanged(DependencyObject d, ResourcesChangeInfo info, Boolean raiseResourceChangedEvent)     at System.Windows.TreeWalkHelper.OnResourcesChangedCallback(DependencyObject d, ResourcesChangeInfo info, Boolean visitedViaVisualTree)     at System.Windows.DescendentsWalker`1.StartWalk(DependencyObject startNode, Boolean skipStartNode)     at System.Windows.TreeWalkHelper.InvalidateOnResourcesChange(FrameworkElement fe, FrameworkContentElement fce, ResourcesChangeInfo info)     at System.Windows.SystemResources.InvalidateTreeResources(Object args)     at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)     at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)

 

Martin Ivanov
Telerik team
commented on 05 Oct 2021, 12:03 PM

There is still no information on the exact reason behind this issue. What I would recommend you is to share a runnable project that shows the issue in this forum. This way I can try it out and my side and see what happens.
Tags
RibbonView and RibbonWindow
Asked by
BENN
Top achievements
Rank 1
Answers by
Martin Ivanov
Telerik team
BENN
Top achievements
Rank 1
Share this question
or