Select to view content in your preferred language

Reusing same Map and Feature layers in different controls

590
1
11-03-2011 11:28 AM
CharlotteCrawford
Emerging Contributor
Hi all,

I have a requirement to develop lots of different controls which all include the same Arc.gis.client.map.  There is also a feature layer and a graphics layer which will be common to all the different controls.  Each control will then add on top of those base layers, having potentially its own graphics layers and/or heatmaplayers.   I'd like to come up  with a clean way of doing this, so that I don't have to copy and paste code around.  I don't want to put the common stuff in all the different controls xaml and code.  In the OO world, I'd use a baseclass, put all the common stuff in that and inherit from it, thereby getting the reuse I am after.  However, in the Silverlight world (which I am fairly new to), I am not sure what the best approach is to achieve this.  I've played around a bit with trying to create a base usercontrol which contains the common stuff and inherit from it, but its proving to be a pain because some stuff is in xaml and some in code.  Could I achieve what I am wanting to do by creating a Custom Control which contains the common stuff? 

Any ideas and suggestions welcome, thanks all.

Cheers
CC
0 Kudos
1 Reply
JenniferNery
Esri Regular Contributor
This thread seems related: http://forums.arcgis.com/threads/37607-Creating-reusable-UserControls. You can read up on creating custom controls in Silverlight, they talk about use of DependencyProperty and Binding.
0 Kudos