Select to view content in your preferred language

Editor Binding Error

624
1
10-26-2011 10:05 AM
BenTreptow1
Deactivated User
I'm getting a null reference exception on my Editor. The Layers property in my Map is databound to my view model and removing this property from the Map seems to eliminate the error, so I'm thinking the Editor control won't work with a Map that has databound layers. Is this true? Does anybody know of a workaround for this?

Here's the error:

System.NullReferenceException
Object reference not set to an instance of an object.
   at ESRI.ArcGIS.Client.Editor.OnMapPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
   at System.Windows.DependencyObject.RaisePropertyChangeNotifications(DependencyProperty dp, Object oldValue, Object newValue)
   at System.Windows.DependencyObject.UpdateEffectiveValue(DependencyProperty property, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, ValueOperation operation)
   at System.Windows.DependencyObject.RefreshExpression(DependencyProperty dp)
   at System.Windows.Data.BindingExpression.SendDataToTarget()
   at System.Windows.Data.BindingExpression.SourceAcquired()
   at System.Windows.Data.BindingExpression.InheritanceContextChanged(Object sender, EventArgs e)
   at System.EventHandler.Invoke(Object sender, EventArgs e)
   at System.Windows.DependencyObject.OnInheritanceContextChanged(Object sender, EventArgs e)
   at MS.Internal.JoltHelper.<>c__DisplayClass4.<RaiseEvent>b__1()

    <UserControl.Resources>
        <ResourceDictionary>
             <esri:Editor x:Key="IdentifyEditor" Map="{Binding ElementName=map_BaseMap}" LayerIDs="{Binding Path=SelectLayer}"/>
        </ResourceDictionary>
    </UserControl.Resources>
    <Grid x:Name="LayoutRoot">
        <esri:Map x:Name="map_BaseMap" Layers="{Binding Path=MapLayers}" MinimumResolution=".25">
            <esri:Map.Extent>
                <esri:Envelope XMin="-10510990.377700" YMin="5586273.272800" XMax="-10364472.557100" YMax="5682307.505400">
                    <esri:Envelope.SpatialReference>
                        <esri:SpatialReference WKID="102100"/>
                    </esri:Envelope.SpatialReference>
                </esri:Envelope>
            </esri:Map.Extent>
        </esri:Map>
0 Kudos
1 Reply
JenniferNery
Esri Regular Contributor
You cannot put Map control under Resources. According to this MSDN Documentation: all objects under resources must be "shareable" http://msdn.microsoft.com/en-us/library/cc903952%28v=vs.95%29.aspx
0 Kudos