refactor<*>: rewrite all codes...

This commit is contained in:
leo 2021-04-29 20:05:55 +08:00
parent 89ff8aa744
commit 30ab8ae954
342 changed files with 17208 additions and 19633 deletions

View file

@ -0,0 +1,24 @@
using System.Collections.ObjectModel;
using System.Windows;
using System.Windows.Controls;
namespace SourceGit.Views.Widgets {
/// <summary>
/// 错误提示面板
/// </summary>
public partial class Exceptions : UserControl {
public ObservableCollection<string> Messages { get; set; }
public Exceptions() {
Messages = new ObservableCollection<string>();
Models.Exception.Handler = e => Dispatcher.Invoke(() => Messages.Add(e));
InitializeComponent();
}
private void Dismiss(object sender, RoutedEventArgs e) {
var data = (sender as Button).DataContext as string;
Messages.Remove(data);
}
}
}