123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- using ComPDFKit.PDFAnnotation;
- using ComPDFKitViewer.AnnotEvent;
- using PDF_Master.CustomControl;
- using PDF_Master.ViewModels.PropertyPanel.AnnotPanel;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows;
- using System.Windows.Controls;
- using System.Windows.Controls.Primitives;
- using System.Windows.Data;
- using System.Windows.Documents;
- using System.Windows.Input;
- using System.Windows.Media;
- using System.Windows.Media.Imaging;
- using System.Windows.Navigation;
- using System.Windows.Shapes;
- namespace PDF_Master.Views.PropertyPanel.AnnotPanel
- {
- /// <summary>
- /// SharpsAnnotProperty.xaml 的交互逻辑
- /// </summary>
- public partial class SharpsAnnotProperty : UserControl
- {
- private SharpsAnnotPropertyViewModel ViewModel => DataContext as SharpsAnnotPropertyViewModel;
- public SharpsAnnotProperty()
- {
- InitializeComponent();
- this.Loaded += Usercontrol_Loaded;
- cusColor.SelectedColorHandler += cusColor_SelectedColor;
- cusFillColor.SelectedColorHandler += CusFillColor_SelectedColorHandler;
- }
- private void CusFillColor_SelectedColorHandler(object sender, Color e)
- {
- if (ViewModel != null)
- {
- ViewModel.SelectedFillColorCommand?.Execute(e);
- }
- }
- private void cusColor_SelectedColor(object sender, Color e)
- {
- if (ViewModel != null)
- {
- ViewModel.SelectedBorderColorCommand?.Execute(e);
- }
- }
- private void Usercontrol_Loaded(object sender, RoutedEventArgs e)
- {
- if (ViewModel != null)
- {
- var str = ViewModel.BasicVm.strOtherTag;
- if (str == "Rect")
- {
- SharpRectBtn.IsChecked = true;
- }
- else if (str == "Circle")
- {
- SharpCircleBtn.IsChecked = true;
- }
- else if (str == "Arrow")
- {
- SharpArrowBtn.IsChecked = true;
- }
- else if (str == "Line")
- {
- SharpLineBtn.IsChecked = true;
- }
- }
- }
- }
- }
|