chr
2024-08-12 e9d7a5ef4c17e4804fb988dd193ff7d1fa36d52b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
using PdmSwPlugin.Common.Entity.DrawAudit;
using PdmSwPlugin.UI;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Runtime.CompilerServices;
using System.Windows;
using System.Windows.Threading;
 
namespace PdmSwPlugin.Commmon.Control
{
    /// <summary>
    /// MultiExWindow.xaml 的交互逻辑
    /// </summary>
    public partial class RichHisWindow : Window, INotifyPropertyChanged
    {
        #region ...
        public virtual event PropertyChangedEventHandler PropertyChanged;
 
        public virtual void RaisePropertyChanged(string name)
        {
            PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(name));
        }
 
        public void RaiseAndSetIfChanged<T>(ref T old, T @new, [CallerMemberName] string propertyName = null)
        {
            old = @new;
            if (propertyName != null)
            {
                RaisePropertyChanged(propertyName);
            }
        }
        #endregion
 
        public readonly static CustomRichBox box = new CustomRichBox();
 
        private string _title;
        public string title
        {
            get => _title;
            set => RaiseAndSetIfChanged(ref _title, value);
        }
 
        private ObservableCollection<DrawAuditHis> _hisList;
 
        public ObservableCollection<DrawAuditHis> HisList
        {
            get => _hisList;
            set => RaiseAndSetIfChanged(ref _hisList, value);
        }
 
 
        public RichHisWindow(DependencyObject parent, string title, List<DrawAuditHis> hisList)
        {
            InitializeComponent();
            this.title = title;
            DataContext = this;
            if (hisList == null)
            {
                this.HisList = new ObservableCollection<DrawAuditHis>();
            }
            else
            {
                this.HisList = new ObservableCollection<DrawAuditHis>(hisList);
            }
        }
 
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            Dispatcher.Invoke(() =>
            {
                // table.ItemsSource = new ObservableCollection<DrawAuditHis>(HisList);
            });
        }
    }
}