/// <summary> /// Creates all our tools. /// </summary> /// <param name='toolboxLayoutDefinition' The layout of the toolbox /> private void CreateTools(ToolboxLayoutDefinition toolboxLayoutDefinition) { Color startColor = new Color( toolboxLayoutDefinition.PaintTools.ColorSetter.Region.BackgroundColor.Red, toolboxLayoutDefinition.PaintTools.ColorSetter.Region.BackgroundColor.Green, toolboxLayoutDefinition.PaintTools.ColorSetter.Region.BackgroundColor.Blue); var brushSizeSelector = this.CreateBrushSizeSelector(startColor, toolboxLayoutDefinition.PaintTools.BrushSizeSelector); this.AddTool(brushSizeSelector); // ColorSetter - shows what colour the user has chosen this.colorSetter = this.CreateColorSetter(startColor, toolboxLayoutDefinition.PaintTools.ColorSetter); this.AddTool(colorSetter); // User defined color selector var colorSelector = this.CreateColorSelector(startColor, toolboxLayoutDefinition.PaintTools.ColorSelector); colorSelector.ColorChanged += (sender, e) => { this.colorSetter.Color = colorSelector.Color; brushSizeSelector.Color = colorSelector.Color; }; this.AddTool(colorSelector); // Pre defined color pickers this.CreateColorPickers(colorSelector, toolboxLayoutDefinition.PaintTools.ColorPickers.ColorPicker); }