12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273 |
- using compdfkit_tools.PDFControl;
- using compdfkit_tools.PDFControlUI;
- 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.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 compdfkit_tools.Annotation.PDFAnnotationControl
- {
- /// <summary>
- /// CPDFAnnotationControl.xaml 的交互逻辑
- /// </summary>
- public partial class CPDFAnnotationControl : UserControl
- {
- public CPDFAnnotationControl()
- {
- InitializeComponent();
- }
- /// <summary>
- /// 获取Bota工具
- /// </summary>
- /// <returns></returns>
- private UIElement GetAnnotationPanel()
- {
- return AnnotationPanelContainer.Child;
- }
- private void SetAnnotationPanel(UIElement newChild)
- {
- AnnotationPanelContainer.Child = newChild;
- }
- /// <summary>
- /// 展开Bota工具
- /// </summary>
- /// <param name="isExpand"></param>
- private void ExpandPanel(bool isExpand)
- {
- AnnotationPanelContainer.Visibility = isExpand ? Visibility.Visible : Visibility.Collapsed;
- }
- public void LoadAnnotationPanel(AnnotationProperties annotationProperties)
- {
- UIElement annotationPanel = GetAnnotationPanel();
- switch (annotationProperties)
- {
- case AnnotationProperties.Highlight:
- CPDFHighlightUI CPDFHighlightUI = new CPDFHighlightUI();
- SetAnnotationPanel(CPDFHighlightUI);
- ExpandPanel(true);
- break;
- case AnnotationProperties.Underline:
- break;
- case AnnotationProperties.Strikeout:
- break;
- default: throw new ArgumentException();
- }
- }
- }
- }
|