From 1dcaa83099123d96265e908f252ab5f4973c2046 Mon Sep 17 00:00:00 2001 From: Isayama_Kagura Date: Mon, 10 Apr 2023 21:32:03 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B8=B8=E6=88=8F=E9=80=89=E6=8B=A9=E7=95=8C?= =?UTF-8?q?=E9=9D=A2=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- TsubakiTranslator/HookResultDisplay.xaml | 10 +-- TsubakiTranslator/HookResultDisplay.xaml.cs | 7 +- TsubakiTranslator/TsubakiTranslator.csproj | 2 +- TsubakiTranslator/UserGamePage.xaml | 85 +++++++++++---------- TsubakiTranslator/UserGamePage.xaml.cs | 6 +- 5 files changed, 54 insertions(+), 56 deletions(-) diff --git a/TsubakiTranslator/HookResultDisplay.xaml b/TsubakiTranslator/HookResultDisplay.xaml index ce24977..a58c10b 100644 --- a/TsubakiTranslator/HookResultDisplay.xaml +++ b/TsubakiTranslator/HookResultDisplay.xaml @@ -6,16 +6,10 @@ xmlns:local="clr-namespace:TsubakiTranslator" xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" mc:Ignorable="d" > - + diff --git a/TsubakiTranslator/HookResultDisplay.xaml.cs b/TsubakiTranslator/HookResultDisplay.xaml.cs index bad9d81..a4c7a8b 100644 --- a/TsubakiTranslator/HookResultDisplay.xaml.cs +++ b/TsubakiTranslator/HookResultDisplay.xaml.cs @@ -31,16 +31,13 @@ public void UpdateHookResultItem(string hookcode, string content) HookItemDict[hookcode].HookText = content; else { + HookData item = new HookData(hookcode, content); + HookItemDict.Add(hookcode, item); //Dispatcher是一个线程控制器,要控制线程里跑的东西,就要经过它。 //WPF里面,有个所谓UI线程,后台代码不能直接操作UI控件,需要控制,就要通过这个Dispatcher。 App.Current.Dispatcher.Invoke((Action)(() => { /// start 你的逻辑代码 - //HookResultItem item = new HookResultItem(hookcode, content, translateWindow); - //HookItemDict.Add(hookcode, item); - //DisplayStackPanel.Children.Add(item); - HookData item = new HookData(hookcode, content); - HookItemDict.Add(hookcode, item); HookDataSet.Add(item); /// end })); diff --git a/TsubakiTranslator/TsubakiTranslator.csproj b/TsubakiTranslator/TsubakiTranslator.csproj index 2dc5914..3dac212 100644 --- a/TsubakiTranslator/TsubakiTranslator.csproj +++ b/TsubakiTranslator/TsubakiTranslator.csproj @@ -15,7 +15,7 @@ OTAKU Technology Co., Ltd. https://github.com/Isayama-Kagura/TsubakiTranslator © 2021 Tsubaki Translator - 1.0.6.0 + 1.0.6.1 Tsubaki Translator 7.0 diff --git a/TsubakiTranslator/UserGamePage.xaml b/TsubakiTranslator/UserGamePage.xaml index 38f8f70..d53118a 100644 --- a/TsubakiTranslator/UserGamePage.xaml +++ b/TsubakiTranslator/UserGamePage.xaml @@ -20,7 +20,7 @@ but we can used the attached property based event to handle the response -->