123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- using System;
- using System.Collections.Generic;
- using System.Collections.ObjectModel;
- using System.ComponentModel;
- using System.Linq;
- using System.Runtime.CompilerServices;
- 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 PDF_Office.Views.BOTA
- {
- public class TextSearchBindItem : INotifyPropertyChanged
- {
- public int ShowPageIndex { get { return BindProperty.PageIndex + 1; } set { BindProperty.PageIndex = value; } }
- public TextBindProperty BindProperty { get; set; }
- public TextSearchBindItem()
- {
- BindProperty = new TextBindProperty();
- }
- public int PageCount { get; set; }
- private int _pageMaxCount;
- public int PageMaxCount { get { return _pageMaxCount; } set { _pageMaxCount = value; OnPropertyChanged("Percent"); } }
- public double Percent { get { if (PageMaxCount > 0 && PageCount >= 0) return (double)PageCount / (double)PageMaxCount; return 0; } }
- public event PropertyChangedEventHandler PropertyChanged;
- protected void OnPropertyChanged([CallerMemberName] string name = null)
- {
- PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(name));
- }
- }
- public class TextBindProperty
- {
- public int PageIndex { get; set; }
- public string TextContent { get; set; }
- public Color HighLightColor { get; set; }
- public string SearchWord { get; set; }
- public Rect TextRect { get; set; }
- public int PageRotate { get; set; }
- }
- /// <summary>
- /// SearchContent.xaml 的交互逻辑
- /// </summary>
- public partial class SearchContent : UserControl
- {
- // private ObservableCollection<TextSearchBindItem> searchResults;
- public SearchContent()
- {
- InitializeComponent();
- // searchResults = new ObservableCollection<TextSearchBindItem>();
- // ICollectionView groupView = CollectionViewSource.GetDefaultView(searchResults);
- // groupView.GroupDescriptions.Add(new PropertyGroupDescription(nameof(TextSearchBindItem.ShowPageIndex)));
- }
- private void SearchResultList_SelectionChanged(object sender, SelectionChangedEventArgs e)
- {
- }
- }
- }
|