/// <summary> /// Creates the brush size selector. /// </summary> /// <param name='startColor' The color we will start drawing with /> /// <param name='layoutBrushSizeSelector' The layout information for this brush size selector /> private BrushSizeSelector CreateBrushSizeSelector(Color startColor, ToolboxLayoutDefinitionPaintToolsBrushSizeSelector layoutBrushSizeSelector) { var brushSizeSelector = new BrushSizeSelector( this.GraphicsDisplay, new BrushSizeSelectorDefinition(startColor, layoutBrushSizeSelector, this.Scale)); this.SetBrushSizeRectange(brushSizeSelector.BrushSize); brushSizeSelector.BrushSizeChanged += (sender, e) => { this.SetBrushSizeRectange(brushSizeSelector.BrushSize); }; return brushSizeSelector; }