Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
845
Unhandled exception when minimising XamDialogWindow
posted

I'm displaying a XamDialogWindow but when I minimize it I get the following unhandled exception:

 

> [Window Title]

> Visual Studio Just-In-Time Debugger

> [Main Instruction]

>An unhandled exception ('Unhandled Error in Silverlight Application 

>Code: 4004

>Category: ManagedRuntimeError       

>Message: System.ArgumentException: Value does not fall within the expected range.

>   at MS.Internal.XcpImports.CheckHResult(UInt32 hr)

>   at MS.Internal.XcpImports.FrameworkElement_MeasureOverride(FrameworkElement element, Size availableSize)

>   at System.Windows.Controls.Grid.MeasureOverride(Size constraint)

>   at System.Windows.FrameworkElement.MeasureOverride(IntPtr nativeTarget, Single inWidth, Single inHeight, Single& outWidth, Single& outHeight)     

>') occurred in iexplore.exe [6844].

>The Just-In-Time debugger was launched without necessary security permissions. To debug this process, the Just-In-Time debugger must be run as an Administrator. Would you like to debug this process?

>[V] View process details  [Yes, debug iexplore.exe] [No, cancel debugging]

>[Expanded Information]

>Process Name: C:\Program Files\Internet Explorer\iexplore.exe

 

(See also attached screenshot).

I have repeated this both in my main project and in a test project that contains nothing else other than a button to display the child window.

This only repeats if you have the "Header" object set. Remove the header/title text and the crash doesn't happen. Removing the line:

Content="{TemplateBinding Header}"

From the style definition also gets round the problem. We'll go with this as we're tweaking the style of the window to match our projects look and feel anyway.

The project can be found here:

https://docs.google.com/open?id=0ByA9Ma2avsZqaXZlci1vTjNrcE0