Setting the window's IsEnabled to false causes an infinite loop

Docking/MDI for WPF Forum

Posted 11 months ago by Yuki Abe
Version: 23.1.2
Avatar

Hello

To temporarily prevent the window docking the ToolWindow from manipulating it, setting the window's IsEnabled flag to false will cause a StackOverflowException.
Do you know any reason why this can happen?
The stack trace continues as follows:

 	WindowsBase.dll!System.Windows.DependencyObject.SetValueInternal(System.Windows.DependencyProperty dp, object value)
 	ActiproSoftware.Shared.Wpf.dll!ActiproSoftware.Windows.Media.ImageProvider.kbC(System.Windows.Media.Drawing  , ActiproSoftware.Windows.Media.ImageProviderRequest  )
 	ActiproSoftware.Shared.Wpf.dll!ActiproSoftware.Windows.Media.ImageProvider.kbC(System.Windows.Media.Drawing  , ActiproSoftware.Windows.Media.ImageProviderRequest  )
 	ActiproSoftware.Shared.Wpf.dll!ActiproSoftware.Windows.Media.ImageProvider.MbL(System.Windows.Media.DrawingImage  , ActiproSoftware.Windows.Media.ImageProviderRequest  )
 	ActiproSoftware.Shared.Wpf.dll!ActiproSoftware.Windows.Media.ImageProvider.GetImageSource(System.Windows.Media.ImageSource originalImageSource, ActiproSoftware.Windows.Media.ImageProviderRequest request)
 	ActiproSoftware.Shared.Wpf.dll!ActiproSoftware.Windows.Controls.DynamicImage.MNA(System.Windows.DependencyObject  , object  )
 	WindowsBase.dll!System.Windows.DependencyObject.ProcessCoerceValue(System.Windows.DependencyProperty dp, System.Windows.PropertyMetadata metadata, ref System.Windows.EntryIndex entryIndex, ref int targetIndex, ref System.Windows.EffectiveValueEntry newEntry, ref System.Windows.EffectiveValueEntry oldEntry, ref object oldValue, object baseValue, object controlValue, System.Windows.CoerceValueCallback coerceValueCallback, bool coerceWithDeferredReference, bool coerceWithCurrentValue, bool skipBaseValueChecks)
 	WindowsBase.dll!System.Windows.DependencyObject.UpdateEffectiveValue(System.Windows.EntryIndex entryIndex, System.Windows.DependencyProperty dp, System.Windows.PropertyMetadata metadata, System.Windows.EffectiveValueEntry oldEntry, ref System.Windows.EffectiveValueEntry newEntry, bool coerceWithDeferredReference, bool coerceWithCurrentValue, System.Windows.OperationType operationType)
 	WindowsBase.dll!System.Windows.DependencyObject.InvalidateProperty(System.Windows.DependencyProperty dp, bool preserveCurrentValue)
 	PresentationFramework.dll!System.Windows.StyleHelper.InvalidateDependents(System.Windows.Style ownerStyle, System.Windows.FrameworkTemplate frameworkTemplate, System.Windows.DependencyObject container, System.Windows.DependencyProperty dp, ref MS.Utility.FrugalStructList<System.Windows.ChildPropertyDependent> dependents, bool invalidateOnlyContainer)
 	PresentationFramework.dll!System.Windows.StyleHelper.OnTriggerSourcePropertyInvalidated(System.Windows.Style ownerStyle, System.Windows.FrameworkTemplate frameworkTemplate, System.Windows.DependencyObject container, System.Windows.DependencyProperty dp, System.Windows.DependencyPropertyChangedEventArgs changedArgs, bool invalidateOnlyContainer, ref MS.Utility.FrugalStructList<MS.Utility.ItemStructMap<System.Windows.TriggerSourceRecord>> triggerSourceRecordFromChildIndex, ref MS.Utility.FrugalMap propertyTriggersWithActions, int sourceChildIndex)
 	PresentationFramework.dll!System.Windows.FrameworkElement.OnPropertyChanged(System.Windows.DependencyPropertyChangedEventArgs e)
 	WindowsBase.dll!System.Windows.DependencyObject.NotifyPropertyChange(System.Windows.DependencyPropertyChangedEventArgs args)
 	WindowsBase.dll!System.Windows.DependencyObject.InvalidateSubProperty(System.Windows.DependencyProperty dp)
 	WindowsBase.dll!System.Windows.DependencyObject.NotifySubPropertyChange(System.Windows.DependencyProperty dp)
 	PresentationFramework.dll!System.Windows.Data.BindingExpressionBase.Invalidate(bool isASubPropertyChange)
 	PresentationFramework.dll!System.Windows.Data.BindingExpression.TransferValue(object newValue, bool isASubPropertyChange)
 	PresentationFramework.dll!MS.Internal.Data.PropertyPathWorker.UpdateSourceValueState(int k, System.ComponentModel.ICollectionView collectionView, object newValue, bool isASubPropertyChange)
 	PresentationFramework.dll!MS.Internal.Data.PropertyPathWorker.OnDependencyPropertyChanged(System.Windows.DependencyObject d, System.Windows.DependencyProperty dp, bool isASubPropertyChange)
 	PresentationFramework.dll!System.Windows.Data.BindingExpression.HandlePropertyInvalidation(System.Windows.DependencyObject d, System.Windows.DependencyPropertyChangedEventArgs args)
 	PresentationFramework.dll!System.Windows.Data.BindingExpressionBase.OnPropertyInvalidation(System.Windows.DependencyObject d, System.Windows.DependencyPropertyChangedEventArgs args)
 	PresentationFramework.dll!System.Windows.Data.BindingExpression.OnPropertyInvalidation(System.Windows.DependencyObject d, System.Windows.DependencyPropertyChangedEventArgs args)
 	WindowsBase.dll!System.Windows.DependentList.InvalidateDependents(System.Windows.DependencyObject source, System.Windows.DependencyPropertyChangedEventArgs sourceArgs)
 	WindowsBase.dll!System.Windows.DependencyObject.NotifyPropertyChange(System.Windows.DependencyPropertyChangedEventArgs args)
 	WindowsBase.dll!System.Windows.DependencyObject.InvalidateSubProperty(System.Windows.DependencyProperty dp)
 	WindowsBase.dll!System.Windows.Freezable.GetChangeHandlersAndInvalidateSubProperties(ref System.Windows.Freezable.EventStorage calledHandlers)
 	WindowsBase.dll!System.Windows.Freezable.FireChanged()
 	WindowsBase.dll!System.Windows.DependencyObject.NotifySubPropertyChange(System.Windows.DependencyProperty dp)
 	PresentationFramework.dll!System.Windows.Data.BindingExpressionBase.Invalidate(bool isASubPropertyChange)
 	PresentationFramework.dll!System.Windows.Data.BindingExpression.TransferValue(object newValue, bool isASubPropertyChange)
 	PresentationFramework.dll!MS.Internal.Data.PropertyPathWorker.UpdateSourceValueState(int k, System.ComponentModel.ICollectionView collectionView, object newValue, bool isASubPropertyChange)
 	PresentationFramework.dll!MS.Internal.Data.PropertyPathWorker.OnDependencyPropertyChanged(System.Windows.DependencyObject d, System.Windows.DependencyProperty dp, bool isASubPropertyChange)
 	PresentationFramework.dll!System.Windows.Data.BindingExpression.HandlePropertyInvalidation(System.Windows.DependencyObject d, System.Windows.DependencyPropertyChangedEventArgs args)
 	PresentationFramework.dll!System.Windows.Data.BindingExpressionBase.OnPropertyInvalidation(System.Windows.DependencyObject d, System.Windows.DependencyPropertyChangedEventArgs args)
 	PresentationFramework.dll!System.Windows.Data.BindingExpression.OnPropertyInvalidation(System.Windows.DependencyObject d, System.Windows.DependencyPropertyChangedEventArgs args)
 	WindowsBase.dll!System.Windows.DependentList.InvalidateDependents(System.Windows.DependencyObject source, System.Windows.DependencyPropertyChangedEventArgs sourceArgs)
 	WindowsBase.dll!System.Windows.DependencyObject.NotifyPropertyChange(System.Windows.DependencyPropertyChangedEventArgs args)
 	WindowsBase.dll!System.Windows.DependencyObject.InvalidateSubProperty(System.Windows.DependencyProperty dp)
 	WindowsBase.dll!System.Windows.Freezable.GetChangeHandlersAndInvalidateSubProperties(ref System.Windows.Freezable.EventStorage calledHandlers)
 	WindowsBase.dll!System.Windows.Freezable.GetChangeHandlersAndInvalidateSubProperties(ref System.Windows.Freezable.EventStorage calledHandlers)
 	WindowsBase.dll!System.Windows.Freezable.GetChangeHandlersAndInvalidateSubProperties(ref System.Windows.Freezable.EventStorage calledHandlers)
 	WindowsBase.dll!System.Windows.Freezable.FireChanged()
 	WindowsBase.dll!System.Windows.Freezable.OnPropertyChanged(System.Windows.DependencyPropertyChangedEventArgs e)
 	WindowsBase.dll!System.Windows.DependencyObject.NotifyPropertyChange(System.Windows.DependencyPropertyChangedEventArgs args)
 	WindowsBase.dll!System.Windows.DependencyObject.UpdateEffectiveValue(System.Windows.EntryIndex entryIndex, System.Windows.DependencyProperty dp, System.Windows.PropertyMetadata metadata, System.Windows.EffectiveValueEntry oldEntry, ref System.Windows.EffectiveValueEntry newEntry, bool coerceWithDeferredReference, bool coerceWithCurrentValue, System.Windows.OperationType operationType)
 	WindowsBase.dll!System.Windows.DependencyObject.SetValueCommon(System.Windows.DependencyProperty dp, object value, System.Windows.PropertyMetadata metadata, bool coerceWithDeferredReference, bool coerceWithCurrentValue, System.Windows.OperationType operationType, bool isInternal)
 	WindowsBase.dll!System.Windows.DependencyObject.SetValueInternal(System.Windows.DependencyProperty dp, object value)
 	ActiproSoftware.Shared.Wpf.dll!ActiproSoftware.Windows.Media.ImageProvider.kbC(System.Windows.Media.Drawing  , ActiproSoftware.Windows.Media.ImageProviderRequest  )
 	ActiproSoftware.Shared.Wpf.dll!ActiproSoftware.Windows.Media.ImageProvider.kbC(System.Windows.Media.Drawing  , ActiproSoftware.Windows.Media.ImageProviderRequest  )
 	ActiproSoftware.Shared.Wpf.dll!ActiproSoftware.Windows.Media.ImageProvider.MbL(System.Windows.Media.DrawingImage  , ActiproSoftware.Windows.Media.ImageProviderRequest  )
 	ActiproSoftware.Shared.Wpf.dll!ActiproSoftware.Windows.Media.ImageProvider.GetImageSource(System.Windows.Media.ImageSource originalImageSource, ActiproSoftware.Windows.Media.ImageProviderRequest request)
 	ActiproSoftware.Shared.Wpf.dll!ActiproSoftware.Windows.Controls.DynamicImage.MNA(System.Windows.DependencyObject  , object  )

I was originally using the Dock in Legacy in Actipro's v18, and I updated what was working there to the latest version.
Are you aware of any changes in the update that can cause such exceptions?

Comments (2)

Posted 11 months ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hello,

From the stack trace, it appears to be something with DynamicImage and ImageProvider.  Those have been out for a long time though and we haven't had any reports of issues related to disabling them.  We would need to debug this to assist further.

For things like this, please always tell us exact steps to reproduce the issue in one of our samples.  Or alternatively, send our support address a new simple sample project that shows the issue and reference this thread.  Then we can debug with the sample and see what's going on.  Be sure to exclude the bin/obj folders if you send a .zip to our support address.  We'll wait for your reply, thank you.


Actipro Software Support

Posted 11 months ago by Yuki Abe
Avatar

Thanks for the reply.
I reviewed it again myself and it was solved.
It seems to have happened because there was a process passing the wrong resource DrawingImage to DockingWindow.ImageSource.
Sorry for the inconvenience.

The latest build of this product (v24.1.2) was released 2 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.