public MainWindow() { InitializeComponent(); StrokeThicknessSize = 1; StrokeBrush = MyColorConverter.convertToSolidColor("#2196F3"); FillBrush = System.Windows.Media.Brushes.Transparent; Dashes = new DoubleCollection(); }
private void ColorClickHandle(object sender, RoutedEventArgs e) { SolidColorBrush color = null; Button btn = (Button)sender; if (btn == btnColorNoneColor) { color = MyColorConverter.convertToSolidColor("#00FFFFFF"); } if (btn == btnColorFF00A2E8) { color = MyColorConverter.convertToSolidColor("#FF00A2E8"); } if (btn == btnColorFFA349A4) { color = MyColorConverter.convertToSolidColor("#FFA349A4"); } if (btn == btnColorFFFF7F27) { color = MyColorConverter.convertToSolidColor("#FFFF7F27"); } if (btn == btnColorFFED1C24) { color = MyColorConverter.convertToSolidColor("#FFED1C24"); } if (btn == btnColorFF3F48CC) { color = MyColorConverter.convertToSolidColor("#FF3F48CC"); } if (btn == btnColorFF22B14C) { color = MyColorConverter.convertToSolidColor("#FF22B14C"); } if (btn == btnColorFFFFC90E) { color = MyColorConverter.convertToSolidColor("#FFFFC90E"); } if (color != null) { UpdateFillStrokeColor(color); } }
private void ButtonOnClick(object sender, RoutedEventArgs e) { RibbonButton btn = (RibbonButton)sender; if (ActiveButton != null) { SetButtonFocus(ActiveButton, MyColorConverter.convertToSolidColor("#E0E0E0"), 0); } if (btn == btnLineTool) { ActiveButton = btnLineTool; } else if (btn == btnArrowTool) { ActiveButton = btnArrowTool; } else if (btn == btnRectangleTool) { ActiveButton = btnRectangleTool; } else if (btn == btnEllipseTool) { ActiveButton = btnEllipseTool; } else if (btn == btnStar) { ActiveButton = btnStar; } else if (btn == btnSelect) { ActiveButton = btnSelect; } else if (btn == btnInsertText) { ActiveButton = btnInsertText; } else if (btn == btnBoldText) { ActiveButton = btnBoldText; } else if (btn == btnItalicText) { ActiveButton = btnItalicText; } else if (btn == btnUnderlineText) { ActiveButton = btnUnderlineText; } else if (btn == btnStrokeColor) { ActiveButton = btnStrokeColor; } else if (btn == btnFillColor) { ActiveButton = btnFillColor; } if (ActiveButton != null) { SetButtonFocus(ActiveButton, MyColorConverter.convertToSolidColor("#90CAF9"), 0.5); } }