WrappedException: Error HRESULT E_FAIL with RadContextMenu

2 posts, 0 answers
  1. Jochovader
    Jochovader avatar
    6 posts
    Member since:
    Feb 2012

    Posted 15 May 2014 Link to this post

    Hi

    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


    <telerik:RadContextMenu.ContextMenu>
                                           <telerik:RadContextMenu>
                                               <i:Interaction.Triggers>
                                                   <i:EventTrigger EventName="Opened">
                                                       <i:Interaction.Behaviors>
                                                           <ei:ConditionBehavior>
                                                               <ei:ConditionalExpression>
                                                                   <ei:ComparisonCondition LeftOperand="{Binding Attributes.Count}"
                                                                                           Operator="GreaterThan"
                                                                                           RightOperand="0" />
                                                               </ei:ConditionalExpression>
                                                           </ei:ConditionBehavior>
                                                       </i:Interaction.Behaviors>
                                                       <galasoft:EventToCommand Command="{Binding DropDownParcelaCommand,  Source={StaticResource eCampoViewModel}}"
                                                                                CommandParameter="{Binding Attributes.[ParcelaID]}" />
                                                   </i:EventTrigger>
                                               </i:Interaction.Triggers>
                                               <telerik:RadContextMenu.Effect>
                                                   <DropShadowEffect />
                                               </telerik:RadContextMenu.Effect>
                                               <telerik:RadMenuItem FontWeight="ExtraBold"
                                                                    IsCheckable="False">
                                                   <telerik:RadMenuItem.Header>
                                                       <TextBlock Text="{Binding Attributes.[Clave]}"
                                                                  Foreground="#FF80ba26"
                                                                  FontSize="16" />
                                                   </telerik:RadMenuItem.Header>
                                               </telerik:RadMenuItem>
                                               <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]}" />
                                               
                                           </telerik:RadContextMenu>
                                       </telerik:RadContextMenu.ContextMenu>

    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

    Regards
    JLuis











  2. Jochovader
    Jochovader avatar
    6 posts
    Member since:
    Feb 2012

    Posted 15 May 2014 Link to this post

    Nevermind.

    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
  3. DevCraft banner
Back to Top