1
Vote

OOB, TopMost and UpdateLayout

description

Hi!

I am running into a really strange bug.

When using my application in OutOfBrowser mode and setting the Application.Current.MainWindow.TopMost to true, I will get the following exception:

System.ArgumentException was unhandled by user code
Message=Value does not fall within the expected range.
StackTrace:
   at MS.Internal.XcpImports.MethodEx(IntPtr ptr, String name, CValue[] cvData)
   at MS.Internal.XcpImports.MethodEx(DependencyObject obj, String name)
   at System.Windows.UIElement.UpdateLayout()
   at SL4PopupMenu.PopupMenuBase.<>c__DisplayClass30.<Open>b__2e()
InnerException:

at line 1275 of the PopupMenuBase.cs class:
OverlayCanvas.UpdateLayout(); // Update the layout positions before placing the menu.

I have tried different approaches to solve this, however none of them did work.

What could be the problem?

Thank you for your help and prompt reply!

comments