5

There seems to be an "impedance mismatch" (if I can borrow the term) between similar classes in ArcObjects and the WPF runtime libraries. For example, there is a ESRI.ArcGIS.Client.Geometry.Polyline in the WPF runtime and a ESRI.ArcGIS.Geometry.IPolyline (and corresponding PolylineClass) in ArcObjects.

I want to be able to do something like this (or at least similar):

var poly = new ESRI.ArcGIS.Client.Geometry.Polyline();
var ipoly = new ESRI.ArcGIS.Geometry.PolylineClass();

// stuff happens

poly = ipoly;

Is there an easy way to convert between the two? Or am I going to have to write some deep copy methods?

3
  • usually I do something like IPoly = new PolyClass(), and then look the inheritance chain to see if I can cast IPoly into someother IObject.
    – patrick
    Sep 20, 2012 at 21:39
  • Me too. But in this case, it appears there are no common ancestors since they are in different assemblies. And there is actually a Polyline class in ESRI.ArcGIS.Geometry, but that doesn't match the one in ...Client...
    – Keith G
    Sep 20, 2012 at 22:24
  • I am wanting to know about this myself. The link below did not help. If anyone has a suggestion, please post. Thanks! Jan 26, 2013 at 11:39

1 Answer 1

2

This article looks like it might help: Serializing JSON Geometry Objects between Silverlight, WPF and ArcObjects

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.