mirror of
https://gitee.com/langsisi_admin/serein-flow
synced 2026-04-06 16:06:34 +08:00
GIT练习
This commit is contained in:
33
WorkBench/LogWindow.xaml.cs
Normal file
33
WorkBench/LogWindow.xaml.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
using System.Windows;
|
||||
|
||||
namespace Serein.WorkBench
|
||||
{
|
||||
/// <summary>
|
||||
/// DebugWindow.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class LogWindow : Window
|
||||
{
|
||||
public LogWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
public void AppendText(string text)
|
||||
{
|
||||
Dispatcher.BeginInvoke(() =>
|
||||
{
|
||||
LogTextBox.AppendText(text);
|
||||
LogTextBox.ScrollToEnd();
|
||||
});
|
||||
}
|
||||
private void ClearLog_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
LogTextBox.Clear();
|
||||
}
|
||||
|
||||
private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
|
||||
{
|
||||
e.Cancel = true; // 取消关闭操作
|
||||
this.Hide(); // 隐藏窗体而不是关闭
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user