Bug Report T305449
Visible to All Users

BarManager doesn't close popups when it's used inside ViewToContractAdapter as a separate add-in

created 9 years ago

Hi

We are trying to move to a multi-process ui hosting framework where plug-ins are hosted in their own process and the top-level visual component is not a Window, but a ViewToContractAdapter from the Addins namespace:

defined in System.Windows.Presentation.dll

namespace System.AddIn.Pipeline
{
    // Summary:
    //     System.AddIn.Pipeline.FrameworkElementAdapters is used by Windows Presentation
    //     Foundation (WPF) add-ins to convert between a System.Windows.FrameworkElement
    //     and an System.AddIn.Contract.INativeHandleContract.
    public static class FrameworkElementAdapters
    {
        // Summary:
        //     Returns a System.Windows.FrameworkElement that has been converted from an
        //     System.AddIn.Contract.INativeHandleContract.
        //
        // Parameters:
        //   nativeHandleContract:
        //     The System.AddIn.Contract.INativeHandleContract that was passed across the
        //     isolation boundary between the host application and the add-in.
        //
        // Returns:
        //     A System.Windows.FrameworkElement that will be displayed from either the
        //     host application or add-in, depending on the direction in which the UI is
        //     passed between the two.
        [SecurityCritical]
        public static FrameworkElement ContractToViewAdapter(INativeHandleContract nativeHandleContract);
        //
        // Summary:
        //     Returns an System.AddIn.Contract.INativeHandleContract that has been converted
        //     from a System.Windows.FrameworkElement.
        //
        // Parameters:
        //   root:
        //     The System.Windows.FrameworkElement to be passed across the isolation boundary
        //     between the host application and the add-in.
        //
        // Returns:
        //     An System.AddIn.Contract.INativeHandleContract that is passed from either
        //     the host application or the add-in, depending on the direction in which the
        //     UI is passed between the two.
        //
        // Exceptions:
        //   System.InvalidOperationException:
        //     root is not the root element of a tree of elements.
        [SecurityCritical]
        public static INativeHandleContract ViewToContractAdapter(FrameworkElement root);
    }
}

After switching to this, I am running into problems.  So far I noticed 2 below.    Do you assume that the top level control is a window anywhere in your code?

  1. I cannot close the the popups that hold BarSubItems.  Once opened. they stay opened.
  2. 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

Show previous comments (6)
Alexander Russkov (DevExpress) 9 years ago

    Our developers are still working on this issue. We will let you know once we find a fix.

      When are you planning to release 15.1.8?

      Kirill (DevExpress Support) 9 years ago

        Hello,
        In general, we plan to release version 15.1.8 this month. However, we cannot provide you with any precise date when this version will be released. Follow our announcements on our website to be informed about our releases.

        Thanks,
        Kirill

        Answers approved by DevExpress Support

        created 9 years ago

        We have fixed the issue described in this ticket and will include the fix in our next maintenance update. To apply this solution before the official update, request a hotfix by clicking the corresponding link for product versions you require.

        Note: Hotfixes may be unavailable for beta versions and updates that are about to be released.

          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.