using ComPDFKitViewer; using ComPDFKitViewer.AnnotEvent; using ComPDFKitViewer.PdfViewer; using PDF_Office.CustomControl; using PDF_Office.Helper; using PDF_Office.Model; using PDFSettings; using Prism.Commands; using Prism.Mvvm; using Prism.Regions; 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.Media; namespace PDF_Office.ViewModels.Tools { public class AnnotToolContentViewModel : BindableBase, INavigationAware { private CPDFViewer PDFViewer; private ViewContentViewModel viewContentViewModel; public DelegateCommand MyToolsCommand { get; set; } public AnnotToolContentViewModel() { MyToolsCommand = new DelegateCommand(BtnMyTools_Click); } private Dictionary ToolExpandDict = new Dictionary(); public void BtnMyTools_Click(CustomIconToggleBtn annotBtn) { Dictionary annotAttribsList = new Dictionary(); UserControl propertyPanel = null; switch (annotBtn.Tag.ToString()) { case "SnapshotEdit": break; case "HighLight": TextHighlightAnnotArgs highlightArgs = new TextHighlightAnnotArgs(); highlightArgs.Color = Color.FromRgb(0xFF, 0xBB, 0x00); highlightArgs.Transparency = 0.5; DefaultAnnotProperty annotProperty = SettingHelper.GetAnnotDefaultProperty(AnnotArgsType.AnnotHighlight); if (annotProperty != null) { highlightArgs.Color = annotProperty.ForgoundColor; highlightArgs.Transparency = annotProperty.Opacity; highlightArgs.Content = annotProperty.NoteText; } annotAttribsList[AnnotAttrib.Color] = highlightArgs.Color; annotAttribsList[AnnotAttrib.Transparency] = highlightArgs.Transparency; annotAttribsList[AnnotAttrib.NoteText] = string.Empty; /* TextAnnotProperty textAnnotProperty = new TextAnnotProperty(); textAnnotProperty.DataChanged += AnnotPropertyPanel_DataChanged; textAnnotProperty.DefaultStored += AnnotProperty_DefaultStored; textAnnotProperty.SetAnnotType(highlightArgs.EventType); textAnnotProperty.SetSelectedColor(highlightArgs.Color); textAnnotProperty.SetSelectOpacity(highlightArgs.Transparency); textAnnotProperty.SetNoteContent(highlightArgs.Content); textAnnotProperty.AnnotEvent = AnnotAttribEvent.GetAnnotAttribEvent(highlightArgs, annotAttribsList); propertyPanel = textAnnotProperty; annotArgs = highlightArgs;*/ if (!ToolExpandDict.ContainsKey("HighLight")) { ToolExpandDict["HighLight"] = true; // viewCtrl.PropRow.Width = new GridLength(256 + (int)SystemParameters.ScrollWidth); } break; case "UnderLine": break; case "Squiggly": break; case "Strikeout": break; case "Freehand": break; case "Freetext": break; case "StickyNote": break; case "Rect": break; case "Circle": break; case "Arrow": break; case "Line": break; case "Stamp": break; case "Image": break; case "Signature": break; case "Link": break; } } public bool IsNavigationTarget(NavigationContext navigationContext) { return true; } public void OnNavigatedFrom(NavigationContext navigationContext) { } public void OnNavigatedTo(NavigationContext navigationContext) { navigationContext.Parameters.TryGetValue(ParameterNames.ViewContentViewModel, out viewContentViewModel); navigationContext.Parameters.TryGetValue(ParameterNames.PDFViewer, out PDFViewer); if (PDFViewer != null) { } } } }