Ticket T305577
Visible to All Users

DockLayoutManager raises System.InvalidOperationException when showing/hiding TabLayoutPanels

created 9 years ago

[DevExpress Support Team: CLONED FROM T305449: Using DevExpress WPF Components with multi-process hosting]
2.  I get this exception when showing/hiding TabLayoutPanel of the DevExpress DockLayoutManager2.  I get this exception when showing/hiding TabLayoutPanel of the DevExpress DockLayoutManager

2015-10-28 13:41:48,432 [1] ERROR ModuleHost.Activation.Program - Exception: System.InvalidOperationException: An infinite loop appears to have resulted from repeatedly invalidating the TimeManager during the Layout/Render process.
   at System.Windows.Media.MediaContext.RenderMessageHandlerCore(Object resizedCompositionTarget)
   at System.Windows.Media.MediaContext.RenderMessageHandler(Object resizedCompositionTarget)
   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 ModuleHost.Activation.Program.RunMain(Stopwatch sw) in c:\Code\HIBISCUS-4.0\Source\Framework\ModuleHost\Activation\Program.cs:line 110
   at ModuleHost.Activation.Program.Main(String[] args) in c:\Code\HIBISCUS-4.0\Source\Framework\ModuleHost\Activation\Program.cs:line 35

The problem number 2 above, the exception is reproducible without the multi-process host.  Please see attached zip file for reproduction of the exception (#2)

Show previous comments (1)

    It's in the DevExpressPlugin.xaml file.
    <dxdo:DockLayoutManager FloatingMode="Window"  AutoHideExpandMode="MouseDown" x:Name="moduleView">
                       <dxdo:LayoutGroup x:Name="rootLayout">
                           <dxdo:LayoutGroup Orientation="Horizontal">

    Actually, Alexander I think that the reason for the crash is this setter in the style:
    <Setter Property="dxdo:AutoHideGroup.AutoHideSize" Value="{Binding LayoutSize, RelativeSource={RelativeSource Self}}" />
    It worked when we were on 13.2, but I think in 15.1 it causes a crash.   Removing this line eliminates the crash, so it's likely that this is a self-inflicted wound.  I think you can close the ticket.

    DevExpress Support Team 9 years ago

      Hi Alex,
      Please accept my apologies for that. It looks like I have downloaded your first sample twice. I have managed to reproduce the issue in the second sample. We have already discussed it in the An invalid exception is raised when the DockLayoutManager is located in a panel with automatic height thread. Try the solution suggested there and let us know your results. If it doesn't help, remove the following setter from the "CollapsableRegionStyle" style:

      XAML
      <Setter Property="dxdo:AutoHideGroup.AutoHideSize" Value="{Binding LayoutSize, RelativeSource={RelativeSource Self}}" />

        Solved.  thx

        Answers approved by DevExpress Support

        created 9 years ago

        You are welcome, Alex.
        As your question has been resolved to your satisfaction, I have copied my original comment into this answer, and you can mark it as a Solution.

        We have already discussed it in the An invalid exception is raised when the DockLayoutManager is located in a panel with automatic height thread. Try the solution suggested there and let us know your results. If it doesn't help, remove the following setter from the "CollapsableRegionStyle" style: [XAML]<Setter Property="dxdo:AutoHideGroup.AutoHideSize" Value="{Binding LayoutSize, RelativeSource={RelativeSource Self}}" />

          Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

          Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.