What has replaced the LayerOverlay.Lock method in the WPF Desktop Edition?
LayerOverlay.Lock no longer available
Hi Craig,
We just checked some of our API change history and didn’t find a method called Lock removed from the class LayerOverlay.
Would you please let us know which version of WPF Desktop Edition you were using that has a method called Lock in LayerOverlay? That would be much help.
Regards,
Tsui
Tsui,
Sorry, I wasn't very clear. I am porting an application from Desktop Edition to WPF Desktop Edition and the class I am referring to is
ThinkGeo.MapSuite.DesktopEdition.OverlayLock
This is used by LayerOverlay.Lock property.
To get the code working I just commented out the call to LayerOverlay.Lock.EnterWriteLock() but I am afraid of what side affects this might introduce.
Thanks.
Hi Craig,
The Overlay in WPF Desktop Edition doesn’t have the Lock property; the multi-thread related issues are taken care internally.
So we think it’s safe to comment out the calls to Lock.
Regards,
Tsui
The WpfMap in v3 had locks on the overlays, the API does not mention changing it, and the WPF Quick Start Guide (wiki.thinkgeo.com/wiki/Map_Suite_Wpf_Desktop_Edition_Quick_Start_Guide) has a note that states that locks must be used:
Notes
Because Desktop Edition uses multi-threading internally for drawing, if you want to change an overlay after the map is initialized, you need to lock the overlay first to avoid threading conflicts. For more information, please have a look at our "How Do I?" sample applications that come with the product.
Is there anything more definitive than "I think that you can safely comment it out"?
Should we set the LockLayerMode somewhere instead?
Hi Scott,
In Wpf Desktop Edition 4.5 or later, it’s a default behavior to lock layers while drawing, so we don’t need to set property “LockLayerMode”.
Regards,
Ivan