We are getting a 'System.Windows.FrameworkContentElement' is not a Visual or Visual3D exception in our application. The application has an XamRibbon, a XamDataChart. The chart is inside of an XamDocPanel.
It is thrown when we drag the panel containing the graph and release the left mouse button.
Is there a fix for this? We are using InfragisticsWPF4.Controls.Charts.XamDataChart version 11.2.20112.2076.
There is four year old bug 6846 mentioned from 2008 for this exception in this forum post: http://es.infragistics.com/community/forums/t/12738.aspx
Here are the Infragistics calls in the exception call stack. There is no inner exception. The full call stack of 75+ calls is also included.
at Infragistics.Windows.Ribbon.GalleryToolDropDownPresenter.OnLostKeyboardFocus(KeyboardFocusChangedEventArgs e) ...many internal Microsfoft calls on the stackat Infragistics.Windows.Ribbon.XamRibbon.TransferFocusOutOfRibbon() at Infragistics.Windows.Ribbon.GalleryTool.OnItemClicked(GalleryItem galleryItem, GalleryItemGroup galleryItemGroup, GalleryItemPresenter presenter) at Infragistics.Windows.Ribbon.GalleryItemPresenter.SelectOrClickItem() at Infragistics.Windows.Ribbon.GalleryItemPresenter.OnMouseLeftButtonUp(MouseButtonEventArgs e)
at MS.Internal.Media.VisualTreeUtils.AsVisual(DependencyObject element, Visual& visual, Visual3D& visual3D) at MS.Internal.Media.VisualTreeUtils.AsNonNullVisual(DependencyObject element, Visual& visual, Visual3D& visual3D) at System.Windows.Media.Visual.IsAncestorOf(DependencyObject descendant) at Infragistics.Windows.Ribbon.GalleryToolDropDownPresenter.OnLostKeyboardFocus(KeyboardFocusChangedEventArgs e) at System.Windows.UIElement.OnLostKeyboardFocusThunk(Object sender, KeyboardFocusChangedEventArgs e) at System.Windows.Input.KeyboardFocusChangedEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget) at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target) at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs) at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised) at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args) at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args) at System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted) at System.Windows.Input.InputManager.ProcessStagingArea() at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input) at System.Windows.Input.KeyboardDevice.ChangeFocus(DependencyObject focus, Int32 timestamp) at System.Windows.Input.KeyboardDevice.TryChangeFocus(DependencyObject newFocus, IKeyboardInputProvider keyboardInputProvider, Boolean askOld, Boolean askNew, Boolean forceToNullIfFailed) at System.Windows.Input.KeyboardDevice.Focus(DependencyObject focus, Boolean askOld, Boolean askNew, Boolean forceToNullIfFailed) at System.Windows.Input.KeyboardDevice.Focus(IInputElement element) at System.Windows.ContentElement.Focus() at System.Windows.FrameworkElement.OnPreviewGotKeyboardFocus(Object sender, KeyboardFocusChangedEventArgs e) at System.Windows.Input.KeyboardFocusChangedEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget) at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target) at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs) at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised) at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args) at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args) at System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted) at System.Windows.Input.InputManager.ProcessStagingArea() at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input) at System.Windows.Input.KeyboardDevice.TryChangeFocus(DependencyObject newFocus, IKeyboardInputProvider keyboardInputProvider, Boolean askOld, Boolean askNew, Boolean forceToNullIfFailed) at System.Windows.Input.KeyboardDevice.Focus(DependencyObject focus, Boolean askOld, Boolean askNew, Boolean forceToNullIfFailed) at System.Windows.Input.KeyboardDevice.Focus(IInputElement element) at System.Windows.Input.Keyboard.Focus(IInputElement element) at Infragistics.Windows.Ribbon.XamRibbon.TransferFocusOutOfRibbon() at Infragistics.Windows.Ribbon.GalleryTool.OnItemClicked(GalleryItem galleryItem, GalleryItemGroup galleryItemGroup, GalleryItemPresenter presenter) at Infragistics.Windows.Ribbon.GalleryItemPresenter.SelectOrClickItem() at Infragistics.Windows.Ribbon.GalleryItemPresenter.OnMouseLeftButtonUp(MouseButtonEventArgs e) at System.Windows.UIElement.OnMouseLeftButtonUpThunk(Object sender, MouseButtonEventArgs e) at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget) at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target) at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs) at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised) at System.Windows.UIElement.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent) at System.Windows.UIElement.OnMouseUpThunk(Object sender, MouseButtonEventArgs e) at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget) at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target) at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs) at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised) at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args) at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args) at System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted) at System.Windows.Input.InputManager.ProcessStagingArea() at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input) at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport) at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel) at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled) at System.Windows.Interop.HwndSource.InputFilterMessage(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.InvokeImpl(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.Threading.Dispatcher.PushFrame(DispatcherFrame frame) at System.Windows.Application.RunDispatcher(Object ignore) at System.Windows.Application.RunInternal(Window window) at System.Windows.Application.Run(Window window) at System.Windows.Application.Run() ...
This was caused by unnecessary Keyboard events being sent by the control even though there was no focus on the control or keyboard activity sent to it.
The work around was to have the control send its keyboard events to c# handlers which would then mark them as handled so that they would not cascade into more keyboard events.
at Infragistics.Windows.Ribbon.GalleryToolDropDownPresenter.OnLostKeyboardFocus(KeyboardFocusChangedEventArgs e)at System.Windows.UIElement.OnLostKeyboardFocusThunk(Object sender, KeyboardFocusChangedEventArgs e)
Hello,
I am just checking your progress on the issue.
If you have any questions, please do not hesitate to ask.
I have been looking through your post and I tried to reproduce the described behavior in a sample project. In this application (XamRibbonDataChart.zip) I set the DataChart in a ContentPane. Even after dragging and dropping the ContentPane no exception has been thrown. I have tested this with 11.2.20112.2076. Would you please have a look at the project and let me know if I am missing something in your scenario? It will be great if you could modify it so that it represents your issue and I could investigate it further. Thank you in advance.