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 { /// /// CPDFAnnotationControl.xaml 的交互逻辑 /// public partial class CPDFAnnotationControl : UserControl { public CPDFAnnotationControl() { InitializeComponent(); } /// /// 获取Bota工具 /// /// private UIElement GetAnnotationPanel() { return AnnotationPanelContainer.Child; } private void SetAnnotationPanel(UIElement newChild) { AnnotationPanelContainer.Child = newChild; } /// /// 展开Bota工具 /// /// 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(); } } } }