using ComPDFKitViewer.AnnotEvent; using System; using System.Collections.Generic; using System.Globalization; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; using System.Windows.Data; using System.Windows.Media; namespace PDF_Master.DataConvert { public class PropertyPanelVisible : IValueConverter { public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { if(value is string) { var panelType = (string)value; if(parameter.ToString() == panelType) switch(panelType) { case "HighLight": return Visibility.Visible; default: break; } } return Visibility.Collapsed; } public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) { throw new NotImplementedException(); } } public class CheckToVisibleMutiConvert : IMultiValueConverter { public object Convert(object[] values, Type targetType, object parameter, System.Globalization.CultureInfo culture) { for (int i = 0; i < values.Length; i++) { if ((bool)values[i] == true) return Visibility.Collapsed; } return Visibility.Visible; } public object[] ConvertBack(object value, Type[] targetTypes, object parameter, System.Globalization.CultureInfo culture) { throw new NotImplementedException(); } } public class ColorToBrushConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { if (value is Color) { return new SolidColorBrush((Color)value); } return Brushes.Transparent; } public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) { throw new NotImplementedException(); } } }