Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I need a way to offer the user a choice of color ramps for the ClassBreaksRenderer. I came across the AxSymbologyControl which was designed for WinForms. I tried also ESRIs (WinForms) example project and it works fine. However, I am building everything with WPF and according to ESRIs documentation one can add a WinForms control like the MapControl with the help of the WindowsFormsHost control. This is what I tried:

<UserControl x:Class="MCDA.VisualizationView"
Height="300" Width="300">
    <WindowsFormsHost Height="176" HorizontalAlignment="Left" Margin="33,102,0,0" Name="symbologyHost" VerticalAlignment="Top" Width="201" />

And in the code behind page:

 private void CreateSymbology()
        _axSymbologyControl = new ESRI.ArcGIS.Controls.AxSymbologyControl();


        _axSymbologyControl.Location = new System.Drawing.Point(8, 16);
        _axSymbologyControl.Size = new System.Drawing.Size(272, 265);

        symbologyHost.Child = _axSymbologyControl;

        //Get the ArcGIS install location
        string sInstall = ESRI.ArcGIS.RuntimeManager.ActiveRuntime.Path;

        //Load the ESRI.ServerStyle file into the SymbologyControl
        _axSymbologyControl.LoadStyleFile(sInstall + @"\Styles\ESRI.ServerStyle");

        //Set the style class
        _axSymbologyControl.StyleClass = esriSymbologyStyleClass.esriStyleClassColorRamps;


        _axSymbologyControl.OnItemSelected += new ESRI.ArcGIS.Controls.ISymbologyControlEvents_Ax_OnItemSelectedEventHandler(_axSymbologyControl_OnItemSelected);

The problem is I can't see the control in my window - it is empty. It seems I miss something important.

In case there is a better approach I would like to hear more about it.

share|improve this question

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.