FreehandAnnotProperty.xaml.cs 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using System.Windows;
  7. using System.Windows.Controls;
  8. using System.Windows.Data;
  9. using System.Windows.Documents;
  10. using System.Windows.Input;
  11. using System.Windows.Media;
  12. using System.Windows.Media.Imaging;
  13. using System.Windows.Navigation;
  14. using System.Windows.Shapes;
  15. namespace PDF_Office.Views.PropertyPanel.AnnotPanel
  16. {
  17. /// <summary>
  18. /// FreehandAnnotProperty.xaml 的交互逻辑
  19. /// </summary>
  20. public partial class FreehandAnnotProperty : UserControl
  21. {
  22. private List<string> colors = new List<string>();
  23. public FreehandAnnotProperty()
  24. {
  25. InitializeComponent();
  26. colors.Add("#FFFF10");
  27. colors.Add("#FF1010");
  28. colors.Add("#10FF10");
  29. colors.Add("#1070FF");
  30. ListColor.ItemsSource = colors;
  31. }
  32. private void ChangeColorMenuItem_Click(object sender, RoutedEventArgs e)
  33. {
  34. var data = (sender as FrameworkElement).DataContext as string;
  35. var listBoxItem = ListColor.ItemContainerGenerator.ContainerFromItem(data) as ListBoxItem;
  36. if (listBoxItem != null)
  37. ColorDropPicker?.ShowLayer(listBoxItem);
  38. }
  39. }
  40. }