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);
|
});
|
}
|
}
|
}
|