This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
I'm getting this error reported to me from users of my application, it looks like the Zoom is somehow set to Infinity (not by my code). Any idea how to resolve this? Here's the stack trace: System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType, Boolean isInternal):340 System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value):22 Mindscape.WpfDiagramming.Foundation.DiagramScrollViewer.SetViewport(Rect viewport):108 Mindscape.WpfDiagramming.Foundation.DiagramScrollViewer.TranslateViewport(Double deltaX, Double deltaY):358 Mindscape.WpfDiagramming.Foundation.DiagramScrollViewer.#4z():136 System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e):82 System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e):8 System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args):0 System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType):1016 System.Windows.DependencyObject.InvalidateProperty(DependencyProperty dp, Boolean preserveCurrentValue):82 System.Windows.Data.BindingExpressionBase.Invalidate(Boolean isASubPropertyChange):68 System.Windows.Data.BindingExpression.TransferValue(Object newValue, Boolean isASubPropertyChange):956 MS.Internal.Data.PropertyPathWorker.UpdateSourceValueState(Int32 k, ICollectionView collectionView, Object newValue, Boolean isASubPropertyChange):232 MS.Internal.Data.PropertyPathWorker.OnDependencyPropertyChanged(DependencyObject d, DependencyProperty dp, Boolean isASubPropertyChange):93 System.Windows.Data.BindingExpression.HandlePropertyInvalidation(DependencyObject d, DependencyPropertyChangedEventArgs args):145 System.Windows.Data.BindingExpressionBase.OnPropertyInvalidation(DependencyObject d, DependencyPropertyChangedEventArgs args):83 System.Windows.Data.BindingExpression.OnPropertyInvalidation(DependencyObject d, DependencyPropertyChangedEventArgs args):181 System.Windows.DependentList.InvalidateDependents(DependencyObject source, DependencyPropertyChangedEventArgs sourceArgs):27 System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args):116 System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType):1016 System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType, Boolean isInternal):686 System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value):22 Mindscape.WpfDiagramming.DiagramSurface.set_Zoom(Double value):12 System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs):63 MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler):17 |
|
|
Sorry about that and thanks for pointing this out. I could not reproduce this, but using the stack trace I have made sure that if something tries to pan the diagram with infinite values, then nothing will happen. I've also made some fixes to ensure we don't set the Zoom to infinity internally. These updates will be available in the next nightly build. The fixes were very straight forward, but as I could not reproduce the issue, do let me know on the off chance that there is still an issue around this. -Jason Fauchelle |
|
|
Thanks for your reply. Could you confirm that it is due to panning?? I was under the impression that's the zooming causing this? So here's the code that was causing this:
the thing is, this code is used in conjunction with the workaround shown here. Notice that they say "layout algorithm is executed before the new bounds are applied" so it might cause this, although I can't reproduce it on my app either, as it is happens sporadically. How long before the nightly builds are rolled into a 'release'? |
|
|
Hello, The stack trace indicates that the exception itself is occurring inside the panning logic (TranslateViewport). Panning can occur after setting the Zoom property to keep the viewport centered. The next nightly build will have guards around both panning and zooming. Nightly builds are version releases of the product. Every now and then we release a new major version which includes all the nightly builds since the previous major build. Major versions are usually only released when breaking changes may occur in new features we work on. There are currently no plans on when a new WPF Diagrams major version would be released. Let me know if you have further questions. -Jason Fauchelle |
|