Hi,
I have a xamrichtexteditor and I am using some basic functionality, such as changing font or changing the font highlight colour
When I open the richtexteditor with text already in and I highlight the text colour or change font I get the following error:
Queue Empty.
Here is the stace trace:
GetCaretLayoutFromDocumentOffset, document offset: 0 not foundCaretLayoutInfo not available!GetCaretLayoutFromDocumentOffset, document offset: 0 not foundCaretLayoutInfo not available!GetCaretLayoutFromDocumentOffset, document offset: 0 not foundCaretLayoutInfo not available!GetCaretLayoutFromDocumentOffset, document offset: 0 not foundCaretLayoutInfo not available!GetCaretLayoutFromDocumentOffset, document offset: 0 not foundCaretLayoutInfo not available!GetCaretLayoutFromDocumentOffset, document offset: 0 not foundCaretLayoutInfo not available!GetCaretLayoutFromDocumentOffset, document offset: 0 not foundCaretLayoutInfo not available!GetCaretLayoutFromDocumentOffset, document offset: 0 not foundCaretLayoutInfo not available!System.Transactions Critical: 0 : http://msdn.microsoft.com/TraceCodes/System/ActivityTracing/2004/07/Reliability/Exception/UnhandledUnhandled exceptionPSFinancials.TaskManager600.vshost.exeSystem.InvalidOperationException, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089Queue empty. at System.Collections.Generic.Queue`1.Dequeue()
Also:
System.InvalidOperationException was unhandled HResult=-2146233079 Message=Queue empty. Source=System StackTrace: at System.Collections.Generic.Queue`1.Dequeue() at Infragistics.Documents.RichText.LayoutNodeBase.PendingOperationManager.ProcessQueues(Boolean proccessAllEntriesSynchronously) at System.Windows.Threading.DispatcherTimer.FireTick(Object unused) at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs) at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler) at System.Windows.Threading.DispatcherOperation.InvokeImpl() at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Windows.Threading.DispatcherOperation.Invoke() at System.Windows.Threading.Dispatcher.ProcessQueue() at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o) at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs) at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler) at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs) at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam) at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg) at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame) at System.Windows.Application.RunInternal(Window window) at System.Windows.Application.Run() at PSFinancials.TaskManager600.App.Main() in d:\Development\600\PSFinancials.TaskManager600\PSFinancials.TaskManager600\obj\Debug\App.g.cs:line 0 at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args) at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly() at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.ThreadHelper.ThreadStart() InnerException:
Any ideas?
Thanks, Grant
I am also seeing the message "GetCaretLayoutFromDocumentOffset..." in the debug console of VS, but with no error or exception.
The exact message is "GetCaretLayoutFromDocumentOffset, document offset: 2697 > length: 2657" (the offset varies). What does it mean ? Is this a warning of a potentialy dangerous operation i'm doing one way and should be doing another way or is it just debug info ?
I'm using the 15.1.20151.255 version of the WPF Infragistics framework.
Hi Grant,
Do you still need assistance on this matter?
I wasn't able to produce an exception using that code. I loaded up a XamRichTextEditor which already had text inside of it and when I click the button there is no exception. Though I have seen the message, "GetCaretLayoutFromDocumentOffset, document offset: 0 not foundCaretLayoutInfo not available!", before. What is the exact version number of the Infragistics assemblies that you are using?
Edit: The full version number. It would look something like this: 15.1.20151.****
I'm using the build in ig commands to do this like so:
<Button Height="22" Margin="2,0,0,0" ToolTip="Toggle Bold"> <Button.Content> <Image Source="../Resources/FontBold_16x16.png" /> </Button.Content> <ig:Commanding.Command> <igPrim:RichTextEditorCommandSource EventName="Click" CommandType="ToggleBoldFormatting" /> </ig:Commanding.Command> </Button>
It is all functionality not just the font colour changing
How are you highlighting the text colour or changing the font? Are you doing this after the XamRichTextEditor has displayed on the screen with the text? Or are you doing this programmatically as soon as the editor finishes loading? Can you share some of your code that does this highlighting?