private void bindList()
        {
            if (ClassBreakConfigItems != null)
            {
                if (ClassBreaksRenderer != null)
                {
                    // Add the default symbol config control
                    DefaultSymbolConfigControl defaultSymbolConfigControl = new DefaultSymbolConfigControl() { 
                         Symbol = ClassBreaksRenderer.DefaultSymbol,
                         SymbolConfigProvider = SymbolConfigProvider,
                         GeometryType = GeometryType,
                    };
                    defaultSymbolConfigControl.DefaultSymbolModified += new EventHandler<SymbolSelectedEventArgs>(defaultSymbolConfigControl_DefaultSymbolModified);
                    ClassBreakConfigItems.Items.Add(defaultSymbolConfigControl);
                    ClassBreakConfigItems.SelectedItem = defaultSymbolConfigControl;

                    foreach (ClassBreakInfo classBreak in ClassBreaksRenderer.Classes)
                    {
                        ClassBreakConfigControl classBreakConfigControl = createNewClassBreakConfigControl(classBreak);
                        ClassBreakConfigItems.Items.Add(classBreakConfigControl);                        
                    }                    
                }
            }
        }
        private void bindUIToLayer()
        {
            GraphicsLayer graphicsLayer = Layer as GraphicsLayer;
            if (graphicsLayer == null)
                return;

            #region Renderer Takes Precedence
            bindingToLayer = true;
            if (GraphicSymbolsTakePrecedence != null)
                GraphicSymbolsTakePrecedence.IsChecked = !graphicsLayer.RendererTakesPrecedence;
            bindingToLayer = false;
            #endregion

            GeometryType = ESRI.ArcGIS.Mapping.Core.LayerExtensions.GetGeometryType(graphicsLayer);

            ClassBreaksRenderer classBreaksRenderer = graphicsLayer.Renderer as ClassBreaksRenderer;
            if (classBreaksRenderer != null)
            {
                if (RendererOptionsContainerControl != null)
                {
                    ClassBreaksRendererOptionsConfigControl optionsConfigControl = new ClassBreaksRendererOptionsConfigControl()
                    {
                        ClassBreaksRenderer = classBreaksRenderer,
                        SymbolConfigProvider = SymbolConfigProvider,
                        GeometryType = GeometryType,
                    };

                    Binding b = new Binding("Foreground") { Source = this };
                    optionsConfigControl.SetBinding(ClassBreaksRendererOptionsConfigControl.ForegroundProperty, b);

                    optionsConfigControl.RendererColorSchemeChanged += new EventHandler<GradientBrushChangedEventArgs>(optionsConfigControl_RendererColorSchemeChanged);
                    optionsConfigControl.RendererClassBreaksChanged += new EventHandler<RendererClassBreaksCountChangedEventArgs>(optionsConfigControl_RendererClassBreaksChanged);
                    RendererOptionsContainerControl.Content = optionsConfigControl;
                }

                if (RendererOptionsContainerBorder != null)
                    RendererOptionsContainerBorder.Visibility = Visibility.Visible;

                if (CurrentSymbolLabel != null)
                    CurrentSymbolLabel.Visibility = Visibility.Visible;

                createClassBreaksRendererSymbolsConfigControl(classBreaksRenderer);
            }
            else
            {
                UniqueValueRenderer uniqueValueRenderer = graphicsLayer.Renderer as UniqueValueRenderer;
                if (uniqueValueRenderer != null)
                {
                    if (RendererOptionsContainerControl != null)
                    {
                        UniqueValueRendererOptionsConfigControl optionsConfigControl = new UniqueValueRendererOptionsConfigControl()
                        {
                            UniqueValueRenderer = uniqueValueRenderer,
                            SymbolConfigProvider = SymbolConfigProvider,
                            GeometryType = GeometryType,
                        };

                        Binding b = new Binding("Foreground") { Source = this };
                        optionsConfigControl.SetBinding(UniqueValueRendererOptionsConfigControl.ForegroundProperty, b);

                        optionsConfigControl.RendererColorSchemeChanged += new EventHandler<GradientBrushChangedEventArgs>(optionsConfigControl_RendererColorSchemeChanged);
                        optionsConfigControl.NewUniqueValueAdded += new EventHandler<NewUniqueValueInfoEventArgs>(optionsConfigControl_NewUniqueValueCreated);
                        optionsConfigControl.DeleteUniqueValueClicked += new EventHandler(optionsConfigControl_DeleteUniqueValueClicked);
                        RendererOptionsContainerControl.Content = optionsConfigControl;
                    }

                    if (RendererSymbolSetContainerControl != null)
                    {
                        UniqueValueRendererSymbolsConfigControl symbolsConfigControl = new UniqueValueRendererSymbolsConfigControl()
                        {
                            UniqueValueRenderer = uniqueValueRenderer,
                            SymbolConfigProvider = SymbolConfigProvider,
                            GeometryType = GeometryType,
                        };

                        Binding b = new Binding("Foreground") { Source = this };
                        symbolsConfigControl.SetBinding(UniqueValueRendererSymbolsConfigControl.ForegroundProperty, b);

                        symbolsConfigControl.UniqueValueRendererModified += new EventHandler<SelectedUniqueValueModificationEventArgs>(symbolsConfigControl_UniqueValueRendererModified);
                        symbolsConfigControl.CurrentUniqueValueChanged += new EventHandler<CurrentUniqueValueChangedEventArgs>(symbolsConfigControl_CurrentUniqueValueChanged);
                        symbolsConfigControl.DefaultClassBreakBeingConfigured += new EventHandler<DefaultClassBreakBeingConfiguredEventArgs>(symbolsConfigControl_DefaultClassBreakBeingConfigured);
                        RendererSymbolSetContainerControl.Content = symbolsConfigControl;
                    }

                    if (RendererOptionsContainerBorder != null)
                        RendererOptionsContainerBorder.Visibility = Visibility.Visible;

                    if (CurrentSymbolLabel != null)
                        CurrentSymbolLabel.Visibility = Visibility.Visible;
                }
                else
                {
                    // No renderer / simple renderer ... clear out the control
                    if (RendererOptionsContainerControl != null)
                        RendererOptionsContainerControl.Content = null;

                    if (RendererSymbolSetContainerControl != null)
                    {
                        ESRI.ArcGIS.Client.Symbols.Symbol defaultSymbol = graphicsLayer.GetDefaultSymbol();
                        DefaultSymbolConfigControl defaultSymbolConfig = new DefaultSymbolConfigControl() { 
                             Symbol = defaultSymbol,
                             SymbolConfigProvider = SymbolConfigProvider,
                             GeometryType = GeometryType,
                        };

                        Binding b = new Binding("Foreground") { Source = this };
                        defaultSymbolConfig.SetBinding(DefaultSymbolConfigControl.ForegroundProperty, b);

                        defaultSymbolConfig.DefaultSymbolModified += new EventHandler<SymbolSelectedEventArgs>(defaultSymbolConfig_DefaultSymbolModified);
                        RendererSymbolSetContainerControl.Content = defaultSymbolConfig;
                        if (SymbolConfigControl != null)
                            SymbolConfigControl.Symbol = defaultSymbol;
                    }

                    if (CurrentSymbolLabel != null)
                        CurrentSymbolLabel.Visibility = Visibility.Collapsed;

                    if (RendererOptionsContainerBorder != null)
                        RendererOptionsContainerBorder.Visibility = Visibility.Collapsed;
                }
            }
        }
        private void bindList()
        {
            if (UniqueValueConfigItems != null)
            {
                if (UniqueValueRenderer != null)
                {
                    // Add the default symbol config control
                    DefaultSymbolConfigControl defaultSymbolConfigControl = new DefaultSymbolConfigControl()
                    {
                        Symbol = UniqueValueRenderer.DefaultSymbol,
                        SymbolConfigProvider = SymbolConfigProvider,
                        GeometryType = GeometryType,
                    };
                    defaultSymbolConfigControl.DefaultSymbolModified += new EventHandler<SymbolSelectedEventArgs>(defaultSymbolConfigControl_DefaultSymbolModified);
                    UniqueValueConfigItems.Items.Add(defaultSymbolConfigControl);
                    UniqueValueConfigItems.SelectedItem = defaultSymbolConfigControl;

                    foreach (UniqueValueInfo uniqueValueInfo in UniqueValueRenderer.Infos)
                    {
                        UniqueValueConfigControl uniqueValueConfigControl = createNewUniqueValueConfigControl(uniqueValueInfo);
                        UniqueValueConfigItems.Items.Add(uniqueValueConfigControl);
                    }
                }
            }
        }