ThinkGeo.com    |     Documentation    |     Premium Support

Custom Styles

I have run into a situation and need some advice on hopw to proceed.  I am using custom styple to draw all of the features on my maps.  The custom styles are used for several reasons, but on of those reasons is to allow me to use custom color schemes.  I now want to have different map windows displaying  features using different color schemes, so my customn style needs to be associated with a particular map window.


I haven't tried this yet, I need to know if I am going to run into problems if my constructor for my custom style includes an argument for the map window as follows:




[Serializable]
class MyPointStyle : PointStyle
{
    private PointStyle mPointStyle;
    private WinFormsMap mMapWindow;

    public MyPointStyle()
        : this(new PointStyle())
    { }

    public MyPointStyle(WinFormsMap iMapWindow)
    {
        this.mMapWindow = iMapWindow;
    }
 



Charles, 
  
 First let me say that these is nothing technicially wrong with this.  Having said that I would avoid at as it causes a circular reference.  I try to avoid that when possible and usally it points to a bad design somewhere that could be better structured.  To help I need a little more info and I have some questions.  First why not just create differnet styles on each map?  What information will the style get from the map?  If I know the data it needs that should be the key to mr understanding.  Also it is maybe not the best form to have a small object like a style take a big object like a map.  Usally as you get lower in the tree it should get more sparse. 
  
 David