using ComPDFKit.PDFAnnotation; using ComPDFKitViewer; using ComPDFKitViewer.AnnotEvent; using ComPDFKitViewer.PdfViewer; using ImTools; using PDF_Master.CustomControl.CompositeControl; using PDF_Master.Helper; using PDF_Master.Model; using PDF_Master.Model.AnnotPanel; using PDF_Master.Properties; using PDF_Master.ViewModels.Tools; using PDF_Master.ViewModels.Tools.AnnotManager; using PDF_Master.Views.Tools; using PDFSettings; using Prism.Commands; using Prism.Mvvm; using Prism.Regions; using System; using System.Collections.Generic; using System.Drawing; using System.Globalization; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; using System.Windows.Controls; using System.Windows.Data; using System.Windows.Media; using static Dropbox.Api.UsersCommon.AccountType; using Color = System.Windows.Media.Color; using Point = System.Windows.Point; namespace PDF_Master.ViewModels.PropertyPanel.AnnotPanel { public class DashStyleConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { if (value is DashStyle) { var dash = value as DashStyle; if (dash.Dashes == null || dash.Dashes.Count == 0 || dash.Dashes[0] == 0) { return DashStyles.Solid.Dashes; } else { DashStyle dashx = new DashStyle(); dashx.Dashes.Add(1); dashx.Dashes.Add(1); return dashx.Dashes; } } return value; } public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) { throw new NotImplementedException(); } } public class SharpsAnnotPropertyViewModel : BindableBase, INavigationAware { #region 属性 private bool isRect = false; public bool IsRect { get { return isRect; } set => SetProperty(ref isRect, value); } private bool isCircle = false; public bool IsCircle { get { return isCircle; } set => SetProperty(ref isCircle, value); } private bool isArrow = false; public bool IsArrow { get { return isArrow; } set => SetProperty(ref isArrow, value); } private bool isLine = false; public bool IsLine { get { return isLine; } set => SetProperty(ref isLine, value); } private string _strShapeChecked = ""; public string StrShapeChecked { get { return _strShapeChecked; } set { SetProperty(ref _strShapeChecked, value); } } public List ThicknessItems { get; protected set; } private AnnotCommon _basicVm = new AnnotCommon(); public AnnotCommon BasicVm { get { return _basicVm; } set => SetProperty(ref _basicVm, value); } private Geometry dataPath = null; public Geometry DataPath { get { return dataPath; } set { SetProperty(ref dataPath, value); } } private DashStyle dash = new DashStyle(); public DashStyle Dash { get { return dash; } set { SetProperty(ref dash, value); } } private bool _isLineAnnot = false; public bool IsLineAnnot { get { return _isLineAnnot; } set { SetProperty(ref _isLineAnnot, value); } } #endregion 属性 private string RectangleTitle = App.MainPageLoader.GetString("ViewRightMenuBlankSpaceAddComment_Rectangle"); private string CircleTitle = App.MainPageLoader.GetString("Annotation-Circle"); private string ArrowTitle = App.MainPageLoader.GetString("ViewRightMenu_Arrow"); private string LineTitle = App.MainPageLoader.GetString("ViewRightMenuBlankSpaceAddComment_StraightLine"); public DelegateCommand SelectedThickCommand { get; set; } public DelegateCommand SelectedBorderColorCommand { get; set; } public DelegateCommand SelectedFillOpacityCommand { get; set; } public DelegateCommand SelectedFillColorCommand { get; set; } public DelegateCommand LineStyleCommand { get; set; } public DelegateCommand SharpsTypeCommand { get; set; } public DelegateCommand ThicknessChangedCommand { get; set; } public DelegateCommand SelectedOpacityValueCommand { get; set; } public event EventHandler LoadPropertyHandler; public IRegionManager region; public SharpsAnnotPropertyViewModel(IRegionManager regionManager) { region = regionManager; InitColorItems(); InitFillColorItems(); InitThicknessItems(); SharpsTypeCommand = new DelegateCommand(SharpsType_Command); SelectedFillOpacityCommand = new DelegateCommand(SelectedFillOpacity_Command); SelectedFillColorCommand = new DelegateCommand(SelectedFillColor_Command); SelectedThickCommand = new DelegateCommand(SelectedThick_Command); SelectedBorderColorCommand = new DelegateCommand(SelectedBorderColor); SelectedOpacityValueCommand = new DelegateCommand(SelectedOpacityValue); ThicknessChangedCommand = new DelegateCommand(ThicknessChanged_Command); LineStyleCommand = new DelegateCommand(LineStyle_Command); } private void InitThicknessItems() { ThicknessItems = new List(); ComboDataItem item = new ComboDataItem(1, "pt"); ThicknessItems.Add(item); item = new ComboDataItem(2, "pt"); ThicknessItems.Add(item); item = new ComboDataItem(4, "pt"); ThicknessItems.Add(item); item = new ComboDataItem(6, "pt"); ThicknessItems.Add(item); item = new ComboDataItem(8, "pt"); ThicknessItems.Add(item); } private void InitColorItems() { BasicVm.ColorItems = AnnotColorList.GetColorList(ColorSelectorType.Border); } private void InitFillColorItems() { BasicVm.FillColorItems = AnnotColorList.GetColorList(ColorSelectorType.Fill); } private void ThicknessChanged_Command(object obj) { if (obj != null) { var item = (ComboBoxItem)obj; var content = (string)item.Content; if (content != null) { var intData = int.Parse(content); BasicVm.AnnotThickness = intData; } } } private void SharpsType_Command(object obj) { if (obj != null) { var tag = (string)obj; SharpsType(tag, true); } } private void SharpsType(string tag, bool isFromToolsBtn = false) { Dictionary changeData = new Dictionary(); switch (tag) { case "Rect": RectangleGeometry rectPath = new RectangleGeometry(); rectPath.Rect = new Rect(0, 5, 28, 22); DataPath = rectPath; changeData[AnnotArgsType.AnnotSquare] = tag; IsLineAnnot = false; break; case "Circle": EllipseGeometry circlePath = new EllipseGeometry(); circlePath.RadiusX = 14; circlePath.RadiusY = 14; circlePath.Center = new Point(14, 14); DataPath = circlePath; changeData[AnnotArgsType.AnnotCircle] = tag; IsLineAnnot = false; break; case "Arrow": { ArrowHelper arrowLine = new ArrowHelper(); arrowLine.ArrowLength = 8; arrowLine.LineStart = new Point(8, 24); arrowLine.LineEnd = new Point(24, 8); arrowLine.StartSharp = C_LINE_TYPE.LINETYPE_NONE; arrowLine.EndSharp = C_LINE_TYPE.LINETYPE_ARROW; DataPath = arrowLine.BuildArrowBody(); changeData[AnnotArgsType.AnnotLine] = tag; if (IsLineAnnot == false) IsLineAnnot = true; } break; case "Line": { ArrowHelper arrowLine = new ArrowHelper(); arrowLine.LineStart = new Point(0, 32); arrowLine.LineEnd = new Point(32, 0); DataPath = arrowLine.BuildArrowBody(); changeData[AnnotArgsType.AnnotLine] = tag; if (IsLineAnnot == false) IsLineAnnot = true; } break; } if (isFromToolsBtn) PropertyPanel.AnnotTypeChangedInvoke(this, changeData); StrShapeChecked = tag; PropertyPanel.SharpsAnnot = tag; BasicVm.SetOtherTag(tag); } private void LineStyle_Command(object obj) { if (obj != null) { var tag = obj as string; if (tag == "Solid") { DashStyle dashAnnot = new DashStyle(); dashAnnot.Dashes.Add(0); dashAnnot.Dashes.Add(0); Dash = dashAnnot; PropertyPanel.UpdateAnnotAAttrib(AnnotAttrib.LineStyle, DashStyles.Solid); } else { DashStyle dashAnnot = new DashStyle(); dashAnnot.Dashes.Add(1); dashAnnot.Dashes.Add(1); Dash = dashAnnot; PropertyPanel.UpdateAnnotAAttrib(AnnotAttrib.LineStyle, dash); } if (BasicVm.IsMultiSelected == false) PropertyPanel.InvokeToMyTools(BasicVm.AnnotType, Annot); } } private void SelectedFillColor_Command(object obj) { if (obj != null && PropertyPanel != null) { //点击空白处 后 会 清空当前的注释对象 ,此操作为了修改属性后,添加 GetLastAnnot(); var colorValue = (Color)obj; if (colorValue != null) { BasicVm.FillColor = new SolidColorBrush(colorValue); BasicVm.FillColor.Opacity = BasicVm.FillOpacity; PropertyPanel.UpdateAnnotAAttrib(AnnotAttrib.FillColor, colorValue); if (BasicVm.IsMultiSelected == false) PropertyPanel.InvokeToMyTools(BasicVm.AnnotType, Annot); } } } private void GetLastAnnot() { if (PropertyPanel.annot == null) { AnnotHandlerEventArgs annotArgs = null; bool isLastAnnot = (PropertyPanel.LastArrowAnnot != null ? true : false); switch (PropertyPanel.SharpsAnnot) { case "Rect": annotArgs = PropertyPanel.LastAnnotDict[AnnotArgsType.AnnotSquare]; break; case "Circle": annotArgs = PropertyPanel.LastAnnotDict[AnnotArgsType.AnnotCircle]; break; case "Arrow": if (isLastAnnot) { annotArgs = PropertyPanel.LastArrowAnnot; } break; case "Line": annotArgs = PropertyPanel.LastAnnotDict[AnnotArgsType.AnnotLine]; break; } if (annotArgs != null) { annotArgs.PageIndex = -1; annotArgs.AnnotIndex = -1; annotArgs.ClientRect = Rect.Empty; PropertyPanel.annot = annotArgs; Annot = annotArgs; PropertyPanel.annotlists = new List(); PropertyPanel.annotlists.Add(PropertyPanel.annot); PropertyPanel.AnnotEvent = AnnotAttribEvent.GetAnnotAttribEvent(Annot, Annot.GetAnnotAttrib()); } } } private void SelectedFillOpacity_Command(object obj) { if (obj != null) { //点击空白处 后 会 清空当前的注释对象 ,此操作为了修改属性后,添加 GetLastAnnot(); BasicVm.FillOpacity = (double)obj; BasicVm.FillColor.Opacity = BasicVm.FillOpacity; PropertyPanel.UpdateAnnotAAttrib(AnnotAttrib.Transparency, BasicVm.FillOpacity); PropertyPanel.InvokeToMyTools(BasicVm.AnnotType, BasicVm.FillOpacity); } } private void SelectedOpacityValue(object obj) { if (obj != null) { //点击空白处 后 会 清空当前的注释对象 ,此操作为了修改属性后,添加 GetLastAnnot(); BasicVm.FillOpacity = (double)obj; BasicVm.FillColor.Opacity = BasicVm.FillOpacity; PropertyPanel.UpdateAnnotAAttrib(AnnotAttrib.Transparency, BasicVm.FillOpacity); PropertyPanel.InvokeToMyTools(BasicVm.AnnotType, BasicVm.FillOpacity); } } private void SelectedBorderColor(object obj) { if (obj != null && PropertyPanel != null) { //点击空白处 后 会 清空当前的注释对象 ,此操作为了修改属性后,添加 GetLastAnnot(); var colorValue = (Color)obj; if (colorValue != null) { BasicVm.BorderColor = new SolidColorBrush(colorValue); BasicVm.BorderColor.Opacity = BasicVm.BorderOpacity; PropertyPanel.UpdateAnnotAAttrib(AnnotAttrib.Color, colorValue); if (BasicVm.IsMultiSelected == false) PropertyPanel.InvokeToMyTools(BasicVm.AnnotType, Annot); } } } private void SelectedThick_Command(object obj) { if (obj is double) { //点击空白处 后 会 清空当前的注释对象 ,此操作为了修改属性后,添加 //GetLastAnnot(); var tran = (double)obj; AnnotArgsType argsType = AnnotArgsType.AnnotSquare; switch (BasicVm.strOtherTag) { case "Rect": argsType = AnnotArgsType.AnnotSquare; break; case "Circle": argsType = AnnotArgsType.AnnotCircle; break; case "Line": argsType = AnnotArgsType.AnnotLine; isLine = true; break; case "Arrow": argsType = AnnotArgsType.AnnotLine; isLine = false; break; } if (BasicVm.IsMultiSelected == false) { if (argsType == BasicVm.AnnotType) { //if(argsType== AnnotArgsType.AnnotLine && isLine) BasicVm.AnnotThickness = tran; PropertyPanel.UpdateAnnotAAttrib(AnnotAttrib.Thickness, tran); } PropertyPanel.InvokeToMyTools(BasicVm.AnnotType, Annot); } else { BasicVm.AnnotThickness = tran; PropertyPanel.UpdateAnnotAAttrib(AnnotAttrib.Thickness, tran); } } } public bool IsNavigationTarget(NavigationContext navigationContext) { return true; } public void OnNavigatedFrom(NavigationContext navigationContext) { BasicVm.IsMultiSelected = false; //PropertyPanel.annot = null; //PropertyPanel.AnnotEvents = null; //PropertyPanel.AnnotEvent = null; //PropertyPanel.annotlists = null; //AnnotEvent = null; //Annot = null; } private void SetAnnotType() { switch (BasicVm.AnnotType) { case AnnotArgsType.AnnotCircle: BasicVm.AnnotTypeTitle = CircleTitle; break; case AnnotArgsType.AnnotSquare: BasicVm.AnnotTypeTitle = RectangleTitle; break; case AnnotArgsType.AnnotLine: var annotLine = Annot as LineAnnotArgs; if (annotLine != null) { if (annotLine.TailLineType == C_LINE_TYPE.LINETYPE_ARROW && annotLine.HeadLineType == C_LINE_TYPE.LINETYPE_NONE) BasicVm.AnnotTypeTitle = ArrowTitle; else BasicVm.AnnotTypeTitle = LineTitle; } break; } } public AnnotAttribEvent AnnotEvent { get; set; } public AnnotHandlerEventArgs Annot; public AnnotTransfer PropertyPanel; public ViewContentViewModel ViewContentViewModel; public void OnNavigatedTo(NavigationContext navigationContext) { navigationContext.Parameters.TryGetValue(ParameterNames.PropertyPanelContentViewModel, out PropertyPanel); navigationContext.Parameters.TryGetValue(ParameterNames.ViewContentViewModel, out ViewContentViewModel); if (PropertyPanel != null) { AnnotEvent = PropertyPanel.AnnotEvent; BasicVm.AnnotType = PropertyPanel.annot.EventType; Annot = PropertyPanel.annot; BasicVm.IsMultiSelected = PropertyPanel.IsMultiSelected; if (BasicVm.IsMultiSelected) { BasicVm.IsSharpAnnotSelected = !BasicVm.IsMultiSelected; IsAttributeEquals(); } else { BasicVm.IsSharpAnnotSelected = PropertyPanel.IsSharpAnnotSelected; GetAnnotProperty(); } LoadPropertyHandler?.Invoke(null, Annot); } } private List ConvertLists() { List FreeTextLists = new List(); foreach (var item in PropertyPanel.annotlists) { var itemFreeText = item as AnnotHandlerEventArgs; if (itemFreeText != null) { FreeTextLists.Add(itemFreeText); } } if (FreeTextLists.Count != PropertyPanel.annotlists.Count) return null; else return FreeTextLists; } private void IsAttributeEquals() { //初始化填充颜色面板显示 IsLineAnnot = false; CircleAnnotArgs args = new CircleAnnotArgs(); SquareAnnotArgs argsSquare = new SquareAnnotArgs(); LineAnnotArgs argsLine = new LineAnnotArgs(); var list = ConvertLists(); Color LineColor = Color.FromArgb(0x01, 0xff, 0xff, 0xff); Color BgColor = Color.FromArgb(0x01, 0xff, 0xff, 0xff); double LineWidth = 2; DashStyle LineDash = new DashStyle(); Color LineColoritem = Color.FromArgb(0x01, 0xff, 0xff, 0xff); Color BgColoritem = Color.FromArgb(0x01, 0xff, 0xff, 0xff); double LineWidthitem = 2; DashStyle LineDashitem = new DashStyle(); if (list != null) { var temp = list[0]; switch (temp.EventType) { case AnnotArgsType.AnnotCircle: args = temp as CircleAnnotArgs; LineColor = args.LineColor; BgColor = args.BgColor; LineWidth = args.LineWidth; LineDash = args.LineDash; break; case AnnotArgsType.AnnotSquare: argsSquare = temp as SquareAnnotArgs; LineColor = argsSquare.LineColor; BgColor = argsSquare.BgColor; LineWidth = argsSquare.LineWidth; LineDash = argsSquare.LineDash; break; case AnnotArgsType.AnnotLine: argsLine = temp as LineAnnotArgs; IsLineAnnot = true; LineColor = argsLine.LineColor; LineWidth = argsLine.LineWidth; LineDash = argsLine.LineDash; break; } Dictionary isNoEqualsDir = new Dictionary(); isNoEqualsDir.Add("FillColor", false); isNoEqualsDir.Add("LineColor", false); isNoEqualsDir.Add("Thickness", false); isNoEqualsDir.Add("ThickSolidDashStyle", false); isNoEqualsDir.Add("AnnotTypeTitle", false); var annots = list.FindAll(u => u.EventType == AnnotArgsType.AnnotSquare); if (annots.Count == list.Count) { if (isNoEqualsDir["AnnotTypeTitle"] == false) { BasicVm.AnnotTypeTitle = RectangleTitle; isNoEqualsDir["AnnotTypeTitle"] = true; } } annots = list.FindAll(u => u.EventType == AnnotArgsType.AnnotCircle); if (annots.Count == list.Count) { if (isNoEqualsDir["AnnotTypeTitle"] == false) { BasicVm.AnnotTypeTitle = CircleTitle; isNoEqualsDir["AnnotTypeTitle"] = true; } } annots = list.FindAll(u => u.EventType == AnnotArgsType.AnnotLine); if (annots.Count == list.Count) { var annotsArrow = list.FindAll(u => (u as LineAnnotArgs).TailLineType == C_LINE_TYPE.LINETYPE_ARROW && (u as LineAnnotArgs).HeadLineType == C_LINE_TYPE.LINETYPE_NONE); if (annots.Count == annotsArrow.Count) { if (isNoEqualsDir["AnnotTypeTitle"] == false) { BasicVm.AnnotTypeTitle = ArrowTitle; isNoEqualsDir["AnnotTypeTitle"] = true; } } var annotsLine = list.FindAll(u => (u as LineAnnotArgs).TailLineType == C_LINE_TYPE.LINETYPE_NONE && (u as LineAnnotArgs).HeadLineType == C_LINE_TYPE.LINETYPE_NONE); if (annots.Count == annotsLine.Count) { if (isNoEqualsDir["AnnotTypeTitle"] == false) { BasicVm.AnnotTypeTitle = LineTitle; isNoEqualsDir["AnnotTypeTitle"] = true; } } else { if (isNoEqualsDir["AnnotTypeTitle"] == false) { BasicVm.AnnotTypeTitle = "Other"; isNoEqualsDir["AnnotTypeTitle"] = true; } } } else { if (isNoEqualsDir["AnnotTypeTitle"] == false) { BasicVm.AnnotTypeTitle = "Other"; isNoEqualsDir["AnnotTypeTitle"] = true; } } foreach (var item in list) { if (item is SquareAnnotArgs) { argsSquare = item as SquareAnnotArgs; LineColoritem = argsSquare.LineColor; BgColoritem = argsSquare.BgColor; LineWidthitem = argsSquare.LineWidth; LineDashitem = argsSquare.LineDash; } if (item is CircleAnnotArgs) { args = item as CircleAnnotArgs; LineColoritem = args.LineColor; BgColoritem = args.BgColor; LineWidthitem = args.LineWidth; LineDashitem = args.LineDash; } if (item is LineAnnotArgs) { argsLine = item as LineAnnotArgs; IsLineAnnot = true; LineColoritem = argsLine.LineColor; LineWidthitem = argsLine.LineWidth; LineDashitem = argsLine.LineDash; } if (item == list[0]) { continue; } //if (isNoEqualsDir["AnnotTypeTitle"] == false) //{ // if (temp.EventType != item.EventType) // { // BasicVm.AnnotTypeTitle = "Other"; // isNoEqualsDir["AnnotTypeTitle"] = true; // } // else // { // var annotLinetemp = temp as LineAnnotArgs; // var annotLineitem = item as LineAnnotArgs; // if (annotLineitem != null && annotLinetemp != null) // { // if (annotLinetemp.TailLineType != annotLineitem.TailLineType) // { // BasicVm.AnnotTypeTitle = "Other"; // isNoEqualsDir["AnnotTypeTitle"] = true; // } // } // } //} if (isNoEqualsDir["FillColor"] == false) { if (BgColor.A != BgColoritem.A || BgColor.R != BgColoritem.R || BgColor.G != BgColoritem.G || BgColor.B != BgColoritem.B) { BasicVm.FillColor = new SolidColorBrush(Color.FromArgb(0x01, 0xff, 0xff, 0xff)); isNoEqualsDir["FillColor"] = true; } } if (isNoEqualsDir["LineColor"] == false) { if (LineColor.A != LineColoritem.A || LineColor.R != LineColoritem.R || LineColor.G != LineColoritem.G || LineColor.B != LineColoritem.B) { BasicVm.BorderColor = new SolidColorBrush(Color.FromArgb(0x01, 0xff, 0xff, 0xff)); isNoEqualsDir["LineColor"] = true; } } if (isNoEqualsDir["Thickness"] == false) { isNoEqualsDir["Thickness"] = true; if (LineWidth > LineWidthitem) { BasicVm.AnnotThickness = LineWidth; } else { BasicVm.AnnotThickness = LineWidthitem; } } if (isNoEqualsDir["ThickSolidDashStyle"] == false) { if (AnnotTransfer.IsSolidStyle(LineDash) != AnnotTransfer.IsSolidStyle(LineDashitem)) { isNoEqualsDir["ThickSolidDashStyle"] = true; } } } ////以下是多选注释的属性相等时 if (isNoEqualsDir["FillColor"] == false) { BasicVm.FillColor = new SolidColorBrush(BgColor); } if (isNoEqualsDir["LineColor"] == false) { BasicVm.BorderColor = new SolidColorBrush(LineColor); } if (isNoEqualsDir["Thickness"] == false) { BasicVm.AnnotThickness = LineWidth; } if (isNoEqualsDir["ThickSolidDashStyle"] == true) { BasicVm.IsSolidLine = BasicVm.IsDashLine = false; } else { var isSolid = AnnotTransfer.IsSolidStyle(LineDash); BasicVm.IsSolidLine = isSolid; BasicVm.IsDashLine = !isSolid; } } } private bool IsSolidStyle(AnnotHandlerEventArgs annot) { bool isSolid = true; if (annot is SquareAnnotArgs) { var Square = Annot as SquareAnnotArgs; isSolid = AnnotTransfer.IsSolidStyle(Square.LineDash); } else if (annot is CircleAnnotArgs) { var Circle = Annot as CircleAnnotArgs; isSolid = AnnotTransfer.IsSolidStyle(Circle.LineDash); } else if (annot is LineAnnotArgs) { var line = Annot as LineAnnotArgs; isSolid = AnnotTransfer.IsSolidStyle(line.LineDash); } return isSolid; } private void GetAnnotProperty() { if (Annot != null) { bool isSolid = true; switch (Annot.EventType) { case AnnotArgsType.AnnotSquare: if (Annot is SquareAnnotArgs) { var Square = Annot as SquareAnnotArgs; BasicVm.BorderColor = new SolidColorBrush(Square.LineColor); BasicVm.FillColor = new SolidColorBrush(Square.BgColor); BasicVm.BorderOpacity = Square.Transparency; BasicVm.FillOpacity = Square.Transparency; BasicVm.AnnotThickness = Square.LineWidth; Dash = Square.LineDash; SharpsType("Rect", false); BasicVm.AnnotTypeTitle = RectangleTitle; IsLineAnnot = false; IsRect = true; } break; case AnnotArgsType.AnnotCircle: if (Annot is CircleAnnotArgs) { var Circle = Annot as CircleAnnotArgs; BasicVm.BorderColor = new SolidColorBrush(Circle.LineColor); BasicVm.FillColor = new SolidColorBrush(Circle.BgColor); BasicVm.BorderOpacity = Circle.Transparency; BasicVm.FillOpacity = Circle.Transparency; BasicVm.AnnotThickness = Circle.LineWidth; Dash = Circle.LineDash; SharpsType("Circle", false); BasicVm.AnnotTypeTitle = CircleTitle; IsLineAnnot = false; IsCircle = true; } break; case AnnotArgsType.AnnotLine: if (Annot is LineAnnotArgs) { var line = Annot as LineAnnotArgs; BasicVm.BorderColor = new SolidColorBrush(line.LineColor); BasicVm.FillColor = new SolidColorBrush(line.LineColor); BasicVm.BorderOpacity = line.Transparency; BasicVm.FillOpacity = line.Transparency; BasicVm.AnnotThickness = line.LineWidth; Dash = line.LineDash; if (line.TailLineType == C_LINE_TYPE.LINETYPE_ARROW && line.HeadLineType == C_LINE_TYPE.LINETYPE_NONE) { SharpsType("Arrow", false); BasicVm.AnnotTypeTitle = ArrowTitle; IsArrow = true; } else { SharpsType("Line", false); BasicVm.AnnotTypeTitle = LineTitle; IsLine = true; } IsLineAnnot = true; } break; } isSolid = IsSolidStyle(Annot); BasicVm.IsSolidLine = isSolid; BasicVm.IsDashLine = !isSolid; } } } }