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.
at MS.Internal.XcpImports.MethodEx(IntPtr ptr, String name, CValue cvData)
at MS.Internal.XcpImports.MethodEx(DependencyObject obj, String name)
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!