Select to view content in your preferred language

Error in Mobile SDK Example

701
4
07-24-2010 09:22 AM
SethPatrich
Deactivated User
There is an overview for the ESRI.ArcGIS.Mobile.WPF.Map Class at:

http://help.arcgis.com/en/arcgismobile/10.0/apis/ArcGISMobile/ESRI.ArcGIS.Mobile~ESRI.ArcGIS.Mobile....

There is an example on that page on how to create and use the map control with a MobileServiceConnection.

The method they show to actually assign the map cache to the map object is:

map1.DataSources.Add(mobileCache1);

However, the ESRI.ArcGIS.Mobile.WPF.Map object has no member called "DataSources".  It has "DataContext", but this has not worked for assigning the Mobile Cache to the map object.

Any ideas?

Thanks,
Seth
0 Kudos
4 Replies
DarleneBanta
Emerging Contributor
Map.MapLayers.AddRange(_mobileCache);
0 Kudos
AlexProtyagov
Emerging Contributor
I wonder what is difference between ESRI.ArcGIS.Mobile.Map  and  ESRI.ArcGIS.Mobile.WPF.Map   ?
0 Kudos
ScottSimon
Emerging Contributor
I wonder what is difference between ESRI.ArcGIS.Mobile.Map  and  ESRI.ArcGIS.Mobile.WPF.Map   ?


Both are map controls. ESRI.ArcGIS.Mobile.Map is a WinForms control; ESRI.ArcGIS.Mobile.WPF.Map is a WPF control.
0 Kudos
DavidMarley
Frequent Contributor
From what I can tell, that entire code snippit is for the older WinForms control, even though the help topic is for the new WPF map and other controls.  Unfortunately I've seen MANY such inconsistencies in the version 10 help.

In any case, I believe what you are looking for is:

mapControl1.MapLayers.AddRange(mobileCache);

If you look at the "Walkthrough_WPF" sample under "C:\Program Files\ArcGIS\Mobile10.0\DeveloperKit\Samples\MobileApplications" this might help you.  I am unable to get that sample to run at the moment, but that's another story/post!!!
0 Kudos