private void Pensize_Click(object sender, MouseButtonEventArgs e) { setPensizeToDefault(); Grid grid = (Grid)sender; switch (grid.Name) { case "size1": size_1.Visibility = Visibility.Collapsed; sizeSelect_1.Visibility = Visibility.Visible; _penSize = 1; break; case "size2": size_2.Visibility = Visibility.Collapsed; sizeSelect_2.Visibility = Visibility.Visible; _penSize = 2; break; case "size3": size_3.Visibility = Visibility.Collapsed; sizeSelect_3.Visibility = Visibility.Visible; _penSize = 3; break; case "size4": size_4.Visibility = Visibility.Collapsed; sizeSelect_4.Visibility = Visibility.Visible; _penSize = 4; break; default: size_1.Visibility = Visibility.Collapsed; sizeSelect_1.Visibility = Visibility.Visible; _penSize = 1; break; } log.DebugFormat("Selected pen size: {0}, color: {1}", _penSize.ToString(), _color); Utils.savePenTypeSelection(_penSize.ToString()); ListenerBrush?.Invoke(_penSize.ToString(), _color); }
private void Color_Click(object sender, MouseButtonEventArgs e) { setColorToDefault(); Grid grid = (Grid)sender; switch (grid.Name) { case "black": color_black.Visibility = Visibility.Collapsed; colorSelect_black.Visibility = Visibility.Visible; _color = (Int16)PenColor.Black; break; case "white": color_white.Visibility = Visibility.Collapsed; colorSelect_white.Visibility = Visibility.Visible; _color = (Int16)PenColor.White; break; case "blue": color_blue.Visibility = Visibility.Collapsed; colorSelect_blue.Visibility = Visibility.Visible; _color = (Int16)PenColor.Blue; break; case "green": color_green.Visibility = Visibility.Collapsed; colorSelect_green.Visibility = Visibility.Visible; _color = (Int16)PenColor.Green; break; case "yellow": color_yellow.Visibility = Visibility.Collapsed; colorSelect_yellow.Visibility = Visibility.Visible; _color = (Int16)PenColor.Yellow; break; case "orange": color_orange.Visibility = Visibility.Collapsed; colorSelect_orange.Visibility = Visibility.Visible; _color = (Int16)PenColor.Orange; break; case "red": color_red.Visibility = Visibility.Collapsed; colorSelect_red.Visibility = Visibility.Visible; _color = (Int16)PenColor.Red; break; case "purple": color_purple.Visibility = Visibility.Collapsed; colorSelect_purple.Visibility = Visibility.Visible; _color = (Int16)PenColor.Purple; break; default: color_black.Visibility = Visibility.Collapsed; colorSelect_black.Visibility = Visibility.Visible; _color = (Int16)PenColor.Black; break; } log.DebugFormat("Selected Color: {0}, value: {1}, pen size: {2}", grid.Name, _color, _penSize.ToString()); ListenerBrush?.Invoke(_penSize.ToString(), _color); }