Skip to content

Instantly share code, notes, and snippets.

@bgrainger
Created November 23, 2015 18:05
Show Gist options
  • Save bgrainger/b9fc07c68e717d572299 to your computer and use it in GitHub Desktop.
Save bgrainger/b9fc07c68e717d572299 to your computer and use it in GitHub Desktop.
XamlParseException call stack
Message: XamlParseException: Document belongs to another FlowDocumentScrollViewer already. in System.Windows.FrameworkTemplate.LoadTemplateXaml(XamlReader templateReader, XamlObjectWriter currentWriter) ArgumentException: Document belongs to another FlowDocumentScrollViewer already. in System.Windows.Controls.FlowDocumentScrollViewer.DocumentChanged(FlowDocument oldDocument, FlowDocument newDocument)
System.Windows.FrameworkTemplate.LoadTemplateXaml(XamlReader templateReader, XamlObjectWriter currentWriter):540
System.Windows.FrameworkTemplate.LoadTemplateXaml(XamlObjectWriter objectWriter):41
System.Windows.FrameworkTemplate.LoadOptimizedTemplateContent(DependencyObject container, IComponentConnector componentConnector, IStyleConnector styleConnector, List`1 affectedChildren, UncommonField`1 templatedNonFeChildrenField):271
System.Windows.FrameworkTemplate.LoadContent(DependencyObject container, List`1 affectedChildren):42
System.Windows.StyleHelper.ApplyTemplateContent(UncommonField`1 dataField, DependencyObject container, FrameworkElementFactory templateRoot, Int32 lastChildIndex, HybridDictionary childIndexFromChildID, FrameworkTemplate frameworkTemplate):293
System.Windows.FrameworkTemplate.ApplyTemplateContent(UncommonField`1 templateDataField, FrameworkElement container):57
System.Windows.FrameworkElement.ApplyTemplate():36
System.Windows.FrameworkElement.MeasureCore(Size availableSize):42
System.Windows.UIElement.Measure(Size availableSize):408
System.Windows.Controls.Control.MeasureOverride(Size constraint):34
System.Windows.FrameworkElement.MeasureCore(Size availableSize):436
System.Windows.UIElement.Measure(Size availableSize):408
System.Windows.ContextLayoutManager.UpdateLayout():498
System.Windows.ContextLayoutManager.UpdateLayoutCallback(Object arg):16
System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks():69
System.Windows.Media.MediaContext.RenderMessageHandlerCore(Object resizedCompositionTarget):98
System.Windows.Media.MediaContext.RenderMessageHandler(Object resizedCompositionTarget):53
System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs):123
MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler):17
System.Windows.Threading.DispatcherOperation.InvokeImpl():158
System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx):112
System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx):4
System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state):47
System.Windows.Threading.DispatcherOperation.Invoke():32
System.Windows.Threading.Dispatcher.ProcessQueue():240
System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled):69
MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled):49
MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o):91
System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs):123
MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler):17
System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs):206
MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam):297
MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg):-1
System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame):72
System.Windows.Application.RunInternal(Window window):240
System.Windows.Application.Run():7
LDLS4.OurApp.InitializeAndRun(ReadOnlyCollection`1 listArgs, SingleInstanceManager sim):239
LDLS4.OurApp.Main(String[] astrArgs):440
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment