This is a migrated thread and some comments may be shown as answers.

WrappedException: Error HRESULT E_FAIL with RadContextMenu

1 Answer 94 Views
This is a migrated thread and some comments may be shown as answers.
Top achievements
Rank 1
Jochovader asked on 15 May 2014, 06:32 AM

I's recently upgraded a SL4 app to SL5, including all the control sets.

But after upgrading to the latest UI for SL control set (v.2014.1.331.1050), I've been having an exception when a RadContextMenu is about to show.

This is part of the code for the menu. It is contained inside a Layer object from Map Control

                                               <i:EventTrigger EventName="Opened">
                                                               <ei:ComparisonCondition LeftOperand="{Binding Attributes.Count}"
                                                                                       RightOperand="0" />
                                                   <galasoft:EventToCommand Command="{Binding DropDownParcelaCommand,  Source={StaticResource eCampoViewModel}}"
                                                                            CommandParameter="{Binding Attributes.[ParcelaID]}" />
                                               <DropShadowEffect />
                                           <telerik:RadMenuItem FontWeight="ExtraBold"
                                                   <TextBlock Text="{Binding Attributes.[Clave]}"
                                                              FontSize="16" />
                                           <telerik:RadMenuItem IsSeparator="True" />
                                           <telerik:RadMenuItem Header="Consultar datos"
                                                                Command="{Binding SelectParcelaCommand, Source={StaticResource eCampoViewModel}}"
                                                                CommandParameter="{Binding Attributes.[ParcelaID]}" />
                                           <telerik:RadMenuItem Header="Administrar ciclos"
                                                                Command="{Binding EditCiclosCommand, Source={StaticResource eCampoViewModel}}"
                                                                CommandParameter="{Binding Attributes.[ParcelaID]}" />

The problem comes when the user right-clicks in a shape within the map control. In that moment, an unhandled exception is raised:

Error HRESULT E_FAIL has been returned from a call to a COM component.

And this is the stack trace for the exception

   at MS.Internal.XcpImports.CheckHResult(UInt32 hr)
   at MS.Internal.XcpImports.FrameworkElement_MeasureOverride(FrameworkElement element, Size availableSize)
   at System.Windows.FrameworkElement.MeasureOverride(Size availableSize)
   at System.Windows.FrameworkElement.MeasureOverride(IntPtr nativeTarget, Single inWidth, Single inHeight, Single& outWidth, Single& outHeight)

-A few more details from my app:
-The XAML with the map is located in a satellite module
-The map control provider is Esri (Arcgis)

What is weird is that I just upgraded the controls from the old version (which works like a charm), but the XAML remains the same.

Any hit? I really hope you can help me solve this because I have like 4 days dealing with it


1 Answer, 1 is accepted

Sort by
Top achievements
Rank 1
answered on 15 May 2014, 07:18 AM

It was a staticresource that couldnt be found in runtime. This resource was used in a content template declared in another xaml.

Thank you so much for your time
Asked by
Top achievements
Rank 1
Answers by
Top achievements
Rank 1
Share this question