AnsweredAssumed Answered

AcceleratedDisplayLayers Group Initialization Exception

Question asked by ccposton on Nov 22, 2013
Latest reply on Nov 22, 2013 by ccposton
I am getting an "Object reference not set to an instance of an object." exception at
StackTrace "   at ESRI.ArcGIS.Client.DrawingSurface..ctor(Single dpi)\r\n   at 
                       ESRI.ArcGIS.Client.AcceleratedDisplayLayers.Initialize() string

as reported in the InitializationFailed handler for my AcceleratedDisplayLayers group.

A sample xaml is provided below. Basically the example below works perfectly fine when I move the local feature layer outside of the AcceleratedDisplayLayers group. If I keep it in the accelerated layers I get the exception.

It should also be noted that my base application is a WinForms app so I have my map in a WPF control that is hosted in my form using ElementHost. I can take the markup below and set it up in a new WPF application and it seems to work as is? Very strange... Hopefully someone else has run into this and has some insight!

Edit: I have now referenced the project containing the WPF control that is giving me the exception to my WPF test project and can load up the control just fine in a WPF window with no initialization exception. Accelerated layers support doesn't seem to like being hosted in a WinForm via ElementHost.

<Grid x:Name="LayoutRoot" Background="#FFE6E6E6" HorizontalAlignment="Stretch">   <Grid.Resources>             <esri:LocalFeatureService x:Key="FeatureService" Path="USCitiesStates.mpk" MaxRecords="30000" />        <esri:SimpleRenderer x:Key="MySimplePolygonRenderer">     <esri:SimpleRenderer.Symbol>      <esri:SimpleFillSymbol Fill="#440000FF" />     </esri:SimpleRenderer.Symbol>    </esri:SimpleRenderer>   </Grid.Resources>          <esri:Map  x:Name="arcMap" Background="#FFE3E3E3" MinimumResolution="0.1">             <esri:AcceleratedDisplayLayers InitializationFailed="AcceleratedDisplayLayers_InitializationFailed">                 <esri:ArcGISLocalFeatureLayer ID="States" Service="{StaticResource FeatureService}" LayerName="States" IsHitTestVisible="False"                         Renderer="{StaticResource MySimplePolygonRenderer}"                       OutFields="*"/>             </esri:AcceleratedDisplayLayers>         </esri:Map>   </Grid>